程序输出向导到()流。
A、New FileStream(Null) B、System.IO.Stream.Null C、New memorystream() D、Null
135、某类SomeClass中两个字段的定义顺序为x,y。使用SoapFormatter将该类的对象obj序列化到流MyStream、传输到服务器、反序列化为一个新的对象obj2后,x和y在对象内的相对顺序为:()。
A、改为y,x B、仍为x,y
C、无法确定顺序,二者都可能
136、为了在Internet中搜索自己需要的WEB服务,可以查询()。 A、http://www.sina.com http://www.sina.com.cn等新闻网站] B、http://www.google.com http://www.google.com等搜索网站 C、http://uddi.microsoft.com/visualstudio等uddi网站 D、http://mail.sina.com.cn等邮件服务网站 137、有如下代码:
public void MyWork(Object state ) {……. }
请问下列语句执行后多少秒,方法MyWork将被执行?() Timer t = New Timer(MyWork,null,0,200) A、200 B、0.2 C、0
D、永远不会被执行
138、在托管代码中访问一个兼容于STA的COM的组件时,要消除代理及存根机制,应该在创建COM对象之前将Thread.CurrenThread的()属性设置为STA.
A、ThreadState B、Priority
C、CurrentCulture D、ApartmentState
139、在用c#编写的控制台程序中创建并访问一个兼容STA的COM组件时,为提高性能,应该为程序入口Main方法设置()属性。
A、
B、
public void mycallback(IAsyncresult ar) {
…………….//回调函数的代码 }
为了进一步获取结果,在回调函数内部从参数ar中提取委托的语句为:() A、mydelegate md =Ctype(Ctype(ar,AsyncResult).Asyncdelegate,mydelegate) B、mydelegate md =Ctype(ar,AsyncResult).AsyncDelegate C、mydelegate md =ar.GetMyDelegate()
16
D、mydelegate md =New mydelegate(ar)
141、NET Framework类SomeClass实现了接口IJOB。为了向COM客户端提供服务,需要导出SomeClass所在的程序集。为了确定导出程序集时IJOB对应的COM接口的类型,应使用()属性附加到IJOB类的定义。
A、[Interfacetype] B、[COM interop] C、[ClassInterface] D、[DllImport]
142、向com客户端公开.NET Framework类SomeClass时,为了避免COM客户端通过类接口访问类的数据,可向类的定义附加( )属性。
A、[ COM Interop] B、[Interfacetype] C、[DllImport] D、[ClassInterface]
143、利用()服务,托管代码可以调用在动态链接库(DLL)(如Win32 API中的DLL)中实现的非托管函数。
A、运行库可调用包装 B、平台调用
C、COM可调用包装 D、信道
144、在DataSet对象中,可通过( )集合遍历DataSet对象中所有的关系对象。 A、Relations B、Tables C、Constraints D、Datareader
145、下列那种类型的数据集可以轻松穿越防火墙?( ) A、ADO.NET的DataSet B、ADO的RecordSet
146、在使用ADO.NET编写连接到SQLServer2000数据库的应用程序时,从提高性能角度考虑,应创建( )类的对象,并调用其open方法连接到数据库。
A、SqlConnection B、OledbConnection C、Connection
D、OdbcConnection
147、类SomeClass的方法Read定义如下: class SomeClass
{ static int i,j,k ; int l,m,n ; public int Read() { return New Integer(){i,j,k}; } }
为了使该类适用于多线程运行环境,方法Read需要对SomeClass类的非静态字段l,m,n进行独占访问。请问应如何修改Read方法的内容?( ) A.
lock(i,j,k) retrun new int[]{i,j,k};
17
B. C. D.
lock(SomeClass) return new int[]{i,j,k}; lock(this) return new int[]{i,j,k};
lock(typeof(SomeClass)) return new int[]{i,j,k};
148、编写自定义属性类Description时,为了明确指出要把该自定义属性应用到哪个编程元素,可以为类Description附加( )属性。
A、[AttributeTarget] B、[AttributeUsage] C、[Conditional] D、[Transaction]
149、多线程VB.NET 程序中,类SomeClass 定义如下: class SomeClass
ReaderWriterLock rwl = New ReaderWriterLock(); private int i ; public void Read() {
rwl.AcquireReaderLock(Timeout.Infinite); Interlocked.Increment(i); Thread.Sleep(1000);
rwl.ReleaseReaderLock(); }
public void Write() {
rwl.AcquireWriterLock(Timeout.Infinite); Interlocked.Decrement(i); Thread.Sleep(1000);
rwl.ReleaseWriterLock(); } }
已知此刻线程Thread1 正在执行Write (),则此时可有多少线程同时调用 Read ()并将i 的值加1?
A. 0 个 B. 1 个 C. 多个 150、为了能将类someclass的静态方法checkstatus放入System.Threading.TthreadPool管理,该方法的签名可以是:().。
A、pubic staic void updateresource(object) B、public staic void updateresource()
C、public staic void updateresource(object,object) D、public staic thread updateresource(object)
151、在编写ASP.NET页面时,若希望在每次页面载入时执行某个操作,则应将相应代码写入()事件处理程序中。 A. 页面的PreRender B. 页面的init C. 页面的Dispose消息 D. 页面的Load
152、若程序集MyWork.dll的配置文件存在,则应起名为()。
18
A. MyWork.dll.config B. MyWork.config C. Config.sys D. Config.info
154、解决方案doremotingcall包含3个项目myserver、myclient、common,场景如下:
myserver和myclient分别为两个c#控制台项目,common为c#类库项目,其中,common项目实现了类helloclass,输出文件为common.dll,myserver引用common.dll,并向.net远程处理框架注册类 A:RemotingConfiguration.RegisterActivatedClientType B:RemotingConfiguration.RegisterActivatedServiceType C:RemotingConfiguration.RegisterWellknownClientType D:RemotingConfiguration.RegisterWellknownServiceType
155、设计someclass时,若希望字段data只能被同一程序集的其他类访问,可以将该字段的访问修饰符设为()。
A、private B、internal C、protected D、public
156、文件mylib.vb中有以下类的声明:
internal class couter {
public class cinner {
private static short mypublicshort =0
} }
则该cinner类的方法dosomething对cinner.mypublicshort的访问权限为()。 A、可访问 B、不可访问
158、为了向需要客户基本验证的web服务器提供“用户名/密码”对,应设置WebRequest的()属性的值。
A、user和password B、Header
C、ClientCertificates D、Credentials
159、为了向需要客户证书验证的web服务器提供有效客户证书,应设置WebRequest的()属性的值。 A、ClientCertificates B、credentials C、headers
D、user和password
160、下列程序中,DllImport属性的用法是否正确?() public class Test
[DllImport(\ public int movefile(string src ,string dst); A、错误 B、正确
161、以下类TestClass中,只读属性Count的声明是否合法?()
19
public class TestClass {
private int i ; public int Count {
get {
return this.i; } } } A、不合法 B、合法
162、在C#程序中,为了给类型CompCS.SringComponent起一个别名CsStringComp,其正确的语法是()。
A、using CsStringComp=CompCS.StringComponent; B、imports CsStringComp=CompCS.StringComponent; C、Alias CsStringComp=CompCS.StringComponent; D、Dim CompVB.StringComponent As CsStringComp
163、在.NET Framework Class Library中提供了()技术,以使托管应用程序可以断开式的方式访问各种数据源。 A、SQL Server B、ADO.NET C、ODBC.NET D、ADO
+164、接口ISomeInterface中只包含一个属性Name,该属性满足: 公有 可读可写 字符串类型 则该接口的定义应为()。 A interface SomeInterface
{public readonly string Name(){get;set;}}
B interface SomeInterface
{public string Name{get;set;}};
c interface SomeInterface
{ string Name{get;set;}}
D、interface SomeInterface
{readonly Name(){get;set;}
165、设计类SomeClass时,若希望字段Data只能被同一程序集的所有派生类访问,可将该字段的访问修饰符设为()。
A、Internal B、Protected C、Private D、Pubic
166、x,y都是类SomeClass的变量。为了测试这两个变量是否引用同一个对象,应使用类SomeClass的下列那个方法进行判断?()
20