发布于 2015-05-08 23:55:47 | 159 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

.NET Framework

.NET 是 Microsoft XML Web services 平台。你可以理解为.NET Framework ,XML Web services 允许应用程序通过 Internet 进行通讯和共享数据,而不管所采用的是哪种操作系统、设备或编程语言。Microsoft .NET 平台提供创建 XML Web services 并将这些服务集成在一起之所需。对个人用户的好处是无缝的、吸引人的体验。


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



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务