1. IIS 装 上 之 后 , 验 证 localhost/ 时 , 显 示 The page cannot be 那要怎么办? dispiayed ,那要怎么办?
解答:IIS 没有安装成功或者默认网站没有启动。
2.新建一个 asp.net web 应用程序,出现说我的指定的 web 服务器运行的不是 . 应用程序, asp.net 1.1 版本,我无法运行 asp.net 应用程序? 版本, 应用程序?
解答:运行 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe –i。
3.aspx 项目不能调试 . 项目不能调试?
解答:虚拟目录没有建立应用
程序:在 IIS 中找到项目的虚拟目录---在虚拟目录上右击鼠标 选择属性---属性中的应用程序点击创建。
4.安装 visual stdio.net 的过程中我出现了如下问题:安装程序已检测到
计算机 . 的过程中我出现了如下
问题: 要求的版本不匹配。 上安装的某些
系统组件与 Visual Studio.NET 要求的版本不匹配。你必须安装这 些组件的另一版本,怎么办? 些组件的另一版本,怎么办?
解答:造成这种现象有多种原因,下面几个方法,你试一下: 1)打开
注册表,找到下面主键并删除 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\pendingfil erenameoperations 2)开始>运行>cmd C:\>\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis 开始安装 ASP.NET (1.1.4322.0)。 已安装完 ASP.
NET (1.1.4322.0)。 regsvr32 -i
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
3)把 IIS 卸掉重装(要设置 frantpage 扩展服务器) ,然后再装.NET。
C#语句怎么编写 语句怎么编写? 5. 从键盘上输入整数要用 C#语句怎么编写?
解答:int x=int.Parse(Console.ReadLine());
索引器”概念 6.C#中如何去理解 “索引器 概念? 中如何去理解 索引器 概念?
解答:索引器提供了一种像访问数组一样访问类或结构的方法。 public class Department { private string name; private const int MAX_EMPLOYEES = 10; private string[] employees = new string[MAX_EMPLOYEES]; //employee array public Department(string departmentName) //constructor { name = departmentName; } public string this [int index] //indexer { get { if (index >= 0 &;&; index < MAX_EMPLOYEES) { return employees[index]; } else
{ throw new System.IndexOutOfRangeException(); } } set { if (index >= 0 &;&; index < MAX_EMPLOYEES) { employees[index] = value; } else { throw new System.IndexOutOfRangeException(); } } } // code for the rest of the class...
}
然后,可以创建这个类的一个实例并访问它,如下面的代码示例所示: class TestDepartment { static void Main() { Department sales = new Department("Sales"); sales[0] = "Nikki"; sales[1] = "Becky"; System.Console.WriteLine("The sales team is {0} and {1}".sales[0].sales[1]); } } 输出为: The sales team is Nikki and Becky
控件的值, 7、怎么获得:RadioButton 这个 Web 控件的值,并把它在 Labe 这
个 Webl 控件 怎么获得 中显示出来? 中显示出来?
解 答 : 假 设
xml:namespace prefix = asp />
获得这个Web控件的值的方法: if(RadioButton1.Checked==true) Label1.Text+=RadioButton1.Text;
的代码如下: 8、WebForm1.aspx 的代码如下:
的代码如下: WebForm1.aspx.cs 的代码如下: private void Button1_Click(object sender, System.EventArgs e) { if(Page.IsValid) Label2.Text="通过验证 通过验证"; Label2.Text="通过验证"; else Label2.Text="未通过验证"; t="未通过验证 Label2.Text="未通过验证"; } 程序运行时,有输入用户名, 显示通过验证 通过验证, 程序运行时,有输入用户名,Label2 显示通过验证,没有输入用户名时为什么 没有显示未通过验证 未通过验证? Label2 没有显示未通过验证?
解答:RequiredFieldValidator 控件能够在服务器端和客户端两端进行验证,没有输入用 户名时,就没有通过客户端的验证,因此不可能回传来响应服务器端的事件。把 RequiredFieldValidator 控件的 EnableClientScript 属性的值改为 False。
WebApplication1 项目的虚拟目录为 localhost/a/ WebApplication1, 9、 后 来 我 把 它 改 为 localhost/b/ WebApplication1 以 后 , 项目在.NET 环境下就打不开了,为什么? WebApplication1 项目在.NET 环境下就打不开了,为什么?
解答:在 WebApplication1 项目下有个 WebApplication1.csproj.
webinfo 文件,你把原来 里面
改为
就可以了。
10 、 WebApplication1 项 目 建 完 后 把 它 的 原 来 对 应 的 文 件 夹 名 字 也 为 WebApplication1,后面我把项目名称和它对应的文件夹名字改为聊天室, WebApplication1,后面我把项目名称和它对应的文件夹名字改为聊天室,项目 就打不开了,为什么? 就打不开了,为什么?
解答:在 WebApplication1 项目下有个 WebApplication1.csproj.webinfo 文件,你把原来 里面
ation1.csproj" /> 改为
就可以了。