
新蛋科技.net工程方面的笔试题.docx
11页新蛋科技.net工程方面的笔试题新蛋科技.net工程方面的笔试题 1、 DataSet和DataReader的区分和相同点,分别适合用于什么样的状况? 答: 2、 有基类如下: public class parent { public parent() { Console.Write(;Parent;); } } 请写出一个子类Son,要求子类的构造函数实现如下的功能:(1)输出儿子的NAME、SEX、AGE、以及Parent,(2)要求在Son的构造函数里不能有任何的吩咐语句出现 public class parent { public parent() { Console.Write(;Parent;); } } public class Son:parent { static string name=null; static int sex=0; static int age=0; public parent(string name,int sex,int age):base() { name=name; sex=sex; age=age; display(); } publci void display() { Console.WriteLine(;name=;+name); Console.WriteLine(;sex=;+sex); Console.WriteLine(;age=;+age); } } 3、 请例举出三种以上进行页面重定向的方式(包括服务端和客户端)。
答: 第一种: Response.Redirect, 其次种: Server.Transfer 第三种: function redirect(url) { document.theForm.action = url; document.theForm.submit(); } 第四种: StringBuilder sb=new StringBuilder(); sb.Append(; ;); Response.Write(sb.ToString()); 4、 写出禁用ViewState的语句 答: Control(详细的某个控件).EnableViewState=false; 5、 请谈一谈.NET的code-behind模式和code_clude模式的区分,和各自的优点及缺点 6、 写出下列七个程序段的输出结果: (1) interface InFace { void fun(); } class MyParent:InFace { public void fun() { Console.WriteLine(;Parent;); } } class MySon:MyParent { public void fun() { Console.WriteLine(;Son;); } } public class MyTest { public static void Main(string[] args) { InFace inf=new MySon(); inf.fun(); } } 结果:Parent (2) interface InFace { void fun(); } class MyParent:InFace { public new void fun() { Console.WriteLine(;Parent;); } } class MySon:MyParent { public void fun() { Console.WriteLine(;Son;); } } public class MyTest { public static void Main(string[] args) { InFace inf=new MySon(); inf.fun(); Console.Read(); } } 结果:Parent (3) interface InFace { void fun(); } class MyParent:InFace { public new void fun() { Console.WriteLine(;Parent;); } } class MySon:MyParent { public new void fun() { Console.WriteLine(;Son;); } } public class MyTest { public static void Main(string[] args) { InFace inf=new MySon(); inf.fun(); Console.Read(); } } 结果:Parent (4) interface InFace { void fun(); } class MyParent:InFace { public void fun() { Console.WriteLine(;Parent;); } } class MySon:MyParent { public override void fun() { Console.WriteLine(;Son;); } } public class MyTest { public static void Main(string[] args) { InFace inf=new MySon(); inf.fun(); Console.Read(); } } 结果:语法错误: 无法重写继承成员;ConsoleApplication6.MyParent.fun();,因为它未标记为 virtual、abstract 或 override本文来源:网络收集与整理,如有侵权,请联系作者删除,谢谢!第11页 共11页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页第 11 页 共 11 页。












