70-536中文(.NET+Framework2.0程序设计)Answer
- 格式:pdf
- 大小:849.57 KB
- 文档页数:42
2.0程序设计课程设计1. 简介2.0是微软公司开发的一种动态网页应用程序框架,它使用了 开发平台和.NET框架。
2.0程序设计课程设计是一门为学生提供2.0开发知识的课程。
该课程设计旨在帮助学生了解2.0技术,掌握2.0程序设计技巧,并能够应用2.0开发Web应用程序。
2. 学习目标本课程设计的学习目标如下:•理解2.0的基本概念和工作原理;•学会使用Visual Studio 2005开发2.0应用程序;•掌握2.0中Web控件、数据绑定、用户认证等高级特性;•熟练掌握2.0 Web服务的开发方式;•了解2.0中的配置文件、调试技巧等高级功能。
3. 学习内容本课程设计的学习内容包括:3.1 2.0基础•2.0架构•Web应用程序的开发原理•2.0中的Web控件•2.0中的页面生命周期3.2 使用Visual Studio 2005开发2.0应用程序•Visual Studio 2005中Web应用程序的创建和基本设置•Visual Studio 2005中Web页面的创建和基本设置•Visual Studio 2005中的代码编辑和调试技巧3.3 2.0高级特性•2.0中的数据绑定•2.0中的用户认证和授权•2.0中的Web服务开发3.4 2.0高级功能•2.0中的配置文件•2.0中的调试技巧和错误处理4. 课程设计要求本课程设计的要求如下:•学生需完整地独立完成一个2.0应用程序并进行演示;•应用程序需包含多个Web页面和使用多个Web控件;•应用程序需使用2.0的高级特性,如数据绑定、用户认证和授权、Web服务等;•应用程序需具有完善的用户界面和交互性;•应用程序需符合2.0开发规范,并能够稳定运行。
5. 总结2.0程序设计课程设计是一门针对2.0开发知识的课程,它可以帮助学生掌握2.0程序设计技巧,了解2.0的高级特性和高级功能。
通过本课程设计的学习,学生可以熟练开发2.0应用程序,提高自己的编程能力。
文章标题:深度剖析:.Net Framework的理解与应用1. .Net Framework的概念与历史.Net Framework是微软公司推出的一个应用程序框架,能够支持广泛的应用程序类型和编程语言。
它的出现标志着软件开发领域的一次革命性的进步,为开发人员提供了更灵活、高效的工具和环境。
.Net Framework的诞生源于微软对软件开发生态的全面理解和需求的深刻反思。
从最初的1.0版本到现在的4.8版本,.Net Framework经历了多次版本更新和技术迭代,已经成为软件开发领域不可或缺的一部分。
2. .Net Framework的核心概念.Net Framework的核心概念包括Common Language Runtime (公共语言运行时,CLR)、Framework Class Library(框架类库,FCL)和多种编程语言的支持。
CLR作为.Net Framework的执行引擎,负责管理程序的执行、内存分配、垃圾回收等任务;FCL则提供了丰富的类库和API,开发人员可以借助这些类库快速构建各类应用程序;.Net Framework支持多种编程语言,包括C#、、F#等,使得开发人员可以根据自己的喜好和项目需求进行选择。
3. 对. Net Framework的个人理解作为一名资深的软件开发人员,我对.Net Framework有着深入的理解和丰富的实践经验。
在我看来,.Net Framework之所以如此受欢迎和广泛应用,是因为它在开发效率、程序性能、安全性等方面都有非常出色的表现。
微软公司积极推动.Net Core的开发,为跨评台和云原生应用提供了更好的支持,使得.Net技术体系更加完善和强大。
4. .Net Framework的应用场景与拥抱未来在实际的项目开发中,.Net Framework可以适用于各种类型的应用程序开发,包括桌面应用、Web应用、移动应用、游戏开发等。
WEB程序设计(版)智慧树知到课后章节答案2023年下青岛科技大学青岛科技大学第一章测试1.模型(Model)是应用程序中用于处理应用程序数据逻辑的部分。
()答案:对2.HTML是一种用于制作超文本文档的简单标记语言。
()答案:对3.CSS可用于控制HTML和XML内容的数据交换形式。
()答案:错4.JavaScript是为适应静态网页的交互性而诞生的一种新的脚本(Script)语言。
()答案:错5.Ajax是指一种创建交互式网页应用的网页开发技术。
()对第二章测试框架中包含编译器 csc.exe。
()答案:对2.处于同一个命名空间中的类必须有明确的相互关系。
()答案:错3.在C#中不存在全局方法和变量,所有的变量和方法都包含在类的定义中。
()答案:对4.C#标识符的首字符必须为字母、下划线或@。
()答案:对5.声明数组时既指定了数组的名字和数组元素的类型,又开辟了内存空间。
()错第三章测试1.类体由成员变量定义和成员方法定义两部分组成。
()答案:对2.C#修饰符按功能可分为两类:类修饰符和成员修饰符。
()答案:错3.构造方法的主要作用是完成对类的对象的初始化工作。
()答案:对4.析构方法能被重载,但不能被继承。
()答案:错5.用protected修饰的成员变量可以被3种类所引用:该类自身、该类的嵌套类及该类的子类。
()对第四章测试1.HTML元素和属性是不区分大小写的,但通常约定标记符使用大写字母。
()答案:对2.<HEAD></HEAD>是HTML文件头标记符,用来描述HTML首部的内容,其作用是说明文档的整体信息。
()答案:对3.在HTML文档中,可以用回车、空格、Tab键来调整文档段落的格式。
()答案:错4.锚点标签定义元素仅限于文字。
()答案:错5.<DIV>称为区隔标记,其作用是将页面分隔为不同的区域。
()对第五章测试与ASP保持语法兼容,但不能同时运行于IIS服务器上。
如何解决Microsoft .NET Framework 2.0 安装问题查看本文应用于的产品重要说明:本文包含有关如何修改注册表的信息。
修改注册表之前,一定要先进行备份,并且一定要知道在发生问题时如何还原注册表。
有关如何备份、还原和修改注册表的更多信息,请单击下面的文章编号,以查看Microsoft 知识库中相应的文章:256986 (/kb/256986/ ) Microsoft Windows 注册表说明简介要求注销然后重新注册Windows Installer修复.NET Framework 2.0在Windows Installer 缓存文件中使用Repair 命令在命令提示符下运行.NET Framework 2.0 可再发行组件包手动删除然后重新安装.NET Framework 2.0参考概要您可以使用本文中的方法解决Microsoft .NET Framework 2.0 版中出现的安装问题。
本文讨论了Microsoft Windows Ser...您可以使用本文中的方法解决Microsoft .NET Framework 2.0 版中出现的安装问题。
本文讨论了Microsoft Windows Server 2003、Windows 2000 Service Pack 3 (SP3) 或Windows XP Service Pack 2 (SP2) 上的安装。
本文介绍的方法包括重新注册Microsoft Windows Installer,以及修复、删除和重新安装.NET Framework。
要使用这些方法,您应当熟悉.NET Framework 2.0、注册表编辑器和Windows Installer。
此外,上述方法中有一种方法需要您更改计算机上的注册表。
简介本文逐步介绍如何解决当安装.NET Framework 2.0 时可能遇到的问题。
如果Windows 注册表中的Microsoft Windows In...本文逐步介绍如何解决当安装.NET Framework 2.0 时可能遇到的问题。
70-529考试资料 Framework 2.0 - Distributed Appl Development科目编号: 70-529科目名称: Framework 2.0 - Distributed Appl Development语言(s):英语,法语,德语,日语考生:开发人员技术:微软Visual Studio 2005类型:监考考试相关:Testinside题库价格:¥272.4070-529 考试是Microsoft 公司的 Framework 2.0 - Distributed Appl Development 认证考试官方代号, Framework 2.0 - Distributed Appl Development 认证作为全球IT 领域专家Microsoft 热门认证之一,是许多大中IT企业选择人才标准的必备条件。
70-529考试概述:About this ExamWhen the exam begins, you can choose the programming language in which the code segments will appear. The available code languages for this exam are:Microsoft Visual Basic 2005Microsoft Visual C# 2005Audience ProfileCandidates for this exam work on a team in a medium or large development environment that uses Microsoft V isual Studio .NET 2003 Enterprise Developer or Visual Studio 2005. Candidates should have at least one year of experience developing distributed applications by using the Microsoft .NET Framework. Candidates should have a working knowledge of V isual Studio 2005. Credit Toward CertificationExam 70-529: TS: Microsoft .NET Framework 2.0 - Distributed Application Development: counts as credit toward the following certification(s):Microsoft Certified Technology Specialist: .NET Framework 2.0 Distributed App lications70-529考试大纲:Creating and Accessing XML Web ServicesCreate and configure an XML Web service method.Create a public method.Attach the WebMethodAttribute attribute.Create a OneWay Web method.Configure a Web service method.Configure a Web service method by using the properties of the WebMethodAttribute attribute. Use discovery files to publish a list of Web services that are installed on a Web server.Build and deploy a Web service application.Configuring and Customizing a Web Service ApplicationConfigure SOAP messages.Configure the formatting of SOAP messages for a Web service method.Specify the basic information for a Web service application.Specify the bindings of a Web service application by using the WebServiceBindingAttribute attribute.Configure a Web service application by using a Machine.config file.Configure a Web service application by using a Web.config file.Configure the Web services communication protocol.Select the formatting of SOAP messages.Specify the parameter formatting.Specify the parameter style.Manage session state in Web services.Implement session state by using the Application object.Implement session state by using cookies.Implement session state by using the Session object.Implement SOAP headers.Add a custom SOAP header class.Create a public instance of the custom SOAP header class in a Web service class. Apply a SoapHeader attribute to a Web method.Access and process a SOAP header in a Web method.Set the direction of a SOAP header.Handle unknown SOAP headers.Implement SOAP extensions.Create a custom SOAP extension.Configure a SOAP extension.Process a SOAP header in a client application.Creating, Configuring, and Deploying Remoting ApplicationsCreate and configure a server application.Create a server application domain.Configure a server application programmatically.Configure a server application by using configuration files.Compile and build a server application.Create a client application to access a remote object.Create a remote object.Configure a client application programmatically.Configure a client application manually by using configuration files.Access the remoting service by calling a remote method.Call a remote method synchronously in a client application.Debug and deploy a remoting application.Use performance counters to monitor a remoting application.Debug a remoting application.Host and deploy a remoting application.Create and serialize remotable types.Create a remotable type.Create generic types.Configure a serialization formatter programmatically.Configure a binary formatter.Configure a SOAP formatter.Implement V ersion Tolerant Serialization (VTS).Manage the lifetime of remote objects.Initialize the lifetime of a remote object.Renew the lifetime of a remote object.Implementing Asynchronous Calls and Remoting EventsCall Web methods asynchronously.Call a Web method.Poll for the completion of a Web method.Get Web method results.Implement callback.Call a OneWay Web method.Call remoting methods asynchronously.Implement one-way methods by using the OneWay attribute.Call a remote method asynchronously.Implement callback.Implement events in remoting applications.Create and fire events.Implement event handler for the events of a remote object.Implementing Web Services Enhancements (WSE) 3.0Enable WSE in client and server applications.Add references to WSE assemblies in client applications.Edit the Web service proxy class to derive from the WebServicesClientProtocol class.Add a element under the element in a configuration file.Add a element to add the section to a configuration file.Add a digital signature to a SOAP message and verify an existing SOAP message signature. Sign a SOAP message digitally.V erify a signed SOAP message.Encrypt and decrypt a SOAP message.Encrypt a SOAP message.Decrypt an encrypted SOAP message.Implement a policy for a Web service application.Create a policy file manually.Declare the set of policies in a policy file.Map policies to SOAP endpoints.Configure a policy file in a configuration file.Create and enforce a custom policy.Create a policy file by using the WseConfigEditor3 tool.Set a policy in a client application and in a client computer.Implement filters in a Web service application.Add a filter.Remove a filter.Shuffle the order of the filters.Enable the Trace filter.Create custom input and output filters.Implement WSE SOAP messaging.Select a protocol.Implement one-way SOAP messaging.Implement bidirectional SOAP messaging.Send the attachments from a Web service application.Receive attachments in a client application.Route SOAP messages by using a WSE router.Create a WSE router application.Configure a WSE router application.Configure a referral cache for routing.Add and verify security credentials.Add security credentials to a SOAP message.V erify security credentials.Creating and Accessing a Serviced Component and Using Message Queuing Create, configure, and access a serviced component.Add a reference to a serviced component in an application.Create an instance of a serviced component.Call the methods of a serviced component.Create a serviced component.Add attributes to a serviced component.Register a serviced component.Implement security.Create, delete, and set permissions on a message queue.Create a message queue manually.Create a message queue programmatically.Delete a message queue.Set permissions for a message queue programmatically.Send messages to a message queue and delete messages from a message queue. Create a message.Post a message.Receive a message synchronously.Decide which formatter to use.Read a message body.Delete queued messages.Sign and encrypt messages.Sign a message.Encrypt a message by using UseEncryption and EncryptionAlgorithm properties. Handle acknowledgments.Receive messages.Peek at messages.Enumerate messages.Receive a message asynchronously.Use BeginReceive/BeginPeek methods.Respond to a ReceiveCompleted or PeekCompleted event.Process messages.V erify a message source by using a certificate.Decrypt a message.Extract response queue details from a message.Compose and send a response to a response queue.Apply a rule to a message queue.70-529考试题库:Exam : Microsoft 70-529Title : Framework 2.0 - Distributed Appl Development1. A Web Services Enhancements (WSE) 3.0 router application uses a referral cache to make routing decisions.When a client application sends a SOAP message to the WSE router application, the following exception isthrown.Microsoft.Web.Services3.Addressing.AddressingFault: MessageInformation Header RequiredThe referral cacheused by the WSE router application is as follows:<?xml version="1.0" ?><r:referralsxmlns:r="/ws/2001/10/referral"> <r:ref> <r:for> <r:exact>/WSERouter/Service.asmx </r:exact> </r:for> <r:if /> <r:go><r:via>/WSEService/Service.asmx</r:via> </r:go> <r:refId>uuid:fa469956-0057-4e77-962a-81c5e292f2ae</r:refId> </r:ref></r:referrals>Y ou need to ensure that a SOAP message can be sent to the WSErouter application without throwing the AddressingFault exception. What should you do?A. Set the AllowAutoRedirect property on the Web service client proxy to True.B. Change the Web service client proxy class definition so that it is derived from the Microsoft.Web.Services3.WebServicesClientProtocol class.C. Set the ConnectionGroupName property on the Web service client proxy to Allow Routing.D. Set the UserAgent property on the Web service client proxy to WSE 3.0.Answer: B2. Y ou are converting an application to use .NET Framework remoting. The server portion of the application monitorsstock prices and contains a class named StockPriceServer, which is a Server Activated Object (SAO). The clientcomputer interacts with the server using a common assembly. When the server attempts to raise an event on theclient computer, the server throws the following exception.System.IO.FileNotFoundException.Y ou discover that theevent delegate is not being called on the client computer. Y ou need to ensure that the server application can raise theevent on the client computer. What should you do?A. Add the Serializable attribute to the StockPriceServer class and change the event to use one of the standardcommon language runtime (CLR) delegates.B. In the common assembly, add an interface that contains the event and a method to raise the event. Implement thatinterface in the StockPriceServer class and use the interface's event to register the delegate message on the clientcomputer.C. Add the event delegate to the common assembly. Implement the Add delegate and the Remove delegate methodsof the event in the StockPriceServer class to reference the delegate method in the client application.D. Raise the event using the BeginInvoke method and pass a reference to the client computer. Answer: B3. A file named Util.asmx contains the following code segment. (Line numbers are included for reference only.)01 <%@ WebService Language="C#" class="Exam.Util" %>02 namespace Exam {03 public class Util {04 public stringGetData() {05 return "data";06 }07 }08 }Y ou need to expose the GetData method through a Web service. What shouldyou do?A. Insert the following line of code between lines 02 and 03.[System.Web.Services.WebService()]B. Replace line 03 with the following line of code.public class Util : System.Web.Services.WebServiceC. Insert the following line of code between lines 03 and 04.[System.Web.Services.WebMethod()]D. Replace line 01 with the following line of code.<%@ WebService Language="C#"class="System.Web.Services.WebService" %>Answer: C4. A Web service exposes a method named GetChart that returns an image. The data used to generate the imagechanges in one-minute intervals. Y ou need to minimize the average time per request for CPU processing. Whatshould you do?A. Set the BufferResponse property on the WebMethod attribute of the GetChart method to True.B. Set the BufferResponse property on the WebMethod attribute of the GetChart method to False.C. Set the CacheDuration property on the WebMethod attribute of the GetChart method to 60.D. Set the CacheDuration property on the WebMethod attribute of the GetChart method to 1. Answer: C5. An assembly named SimpleMathLib is deployed to the Bin folder that is under a virtual directory namedSimpleMathHost, which is on an IIS server named SERVER1. The SimpleMathLib assembly contains the followingspace SimpleMath{ public class SimpleMathClass : MarshalByRefObject{ public double Add(double x,double y) { return x + y; }}The Web.config file under the SimpleMathHost virtual directory contains the properconfiguration to host SimpleMath as a remoting object. Y ou write a client Console Application and add a reference tothe SimpleMathLib assembly. Y ou need to ensure that the client Console Application calls the Addmethod onSERVER1 and returns the correct sum of the parameters to the Console Application. What should you do?A. Write the following code in the client application.TcpChannel chan = new TcpChannel();ChannelServices.RegisterChannel(chan, false);SimpleMath.SimpleMathClass sm = new SimpleMathClass();Console.WriteLine(sm.Add(2, 2).ToString());B. Write the following code in the client application.SimpleMathClass sm = (SimpleMathClass) Activator.GetObject(typeof(SimpleMathClass), "http: //server1:80/SimpleMathHost/SimpleMath.rem");Console.WriteLine(sm.Add(2,2).ToString());C. Write the following code in the client application.SimpleMath.SimpleMathClass sm = (SimpleMathClass)Activator.GetObject(typeof(SimpleMathClass),"tcp: //server1:80/SimpleMathHost/SimpleMath.rem");Console.WriteLine(sm.Add(2,2).ToString());D. Write the following code in the client application.SimpleMath.SimpleMathClass sm = (SimpleMathClass)Activator.CreateInstance(typeof(SimpleMathClass), new string[]{"http: //server1:80/SimpleMathHost/SimpleMath.rem", "SimpleMath.SimpleMathClass, SimpleMathLib"});Console.WriteLine(sm.Add(2, 2).ToString());Answer: B最新活动:Testinside考题大师权威微软,思科,太阳,CIW中,IBM公司,北电网络,惠普,甲骨文等各大的IT认证题库,最新考题售价仅180元起。
什么是.NET Framework?.NET Framework又称 .Net框架。
是由微软开发,一个致力于敏捷软件开发(Agile software development)、快速应用开发(Rapid application development)、平台无关性和网络透明化的软件开发平台。
.NET是微软为下一个十年对服务器和桌面型软件工程迈出的第一步。
.NET包含许多有助于互联网和内部网应用迅捷开发的技术。
.NET框架是微软公司继Windows DNA之后的新开发平台。
.NET框架是以一种采用系统虚拟机运行的编程平台,以通用语言运行库(Common Language Runtime)为基础,支持多种语言(C#、VB、C++、Python等)的开发。
.NET也为应用程序接口(API)提供了新功能和开发工具。
这些革新使得程序设计员可以同时进行Windows应用软件和网络应用软件以及组件和服务(web服务)的开发。
.NET 提供了一个新的反射性的且面向对象程序设计编程接口。
.NET设计得足够通用化从而使许多不同高级语言都得以被汇集。
.NET Framework有哪些版本?.NET框架1.0、.NET框架1.1、.NET框架2.0、.NET框架3.0、.NET框架3.5、.NET 框架4.0。
.net framework各个版本介绍:.NET框架1.0完整版本号- 1.0.3705这是最初的.NET构架,发行于2002年。
它可以以一个独立且可重新分发的包的形式或在一个软件发展工具包集中被获得。
它也是第一个微软Visual Studio .NET的发行版的一部分(也被称作Visual Studio .NET 2002)。
.NET框架1.1完整版本号- 1.1.4322这是首个主要的.NET框架升级版本,发行于2003年。
它可以以一个独立的可重新分发的包的形式或在一个软件发展工具包集中被获得。
它也是第二个微软Visual Studio .NET 版本的一部分(也被称作Visual Studio .NET 2003)。
70-536考试参考资料----V1.0---由于时间仓促,难免有不妥之处,请多谅解你正在开发一个自定义事件处理去自动打印所有打开的文档。
事件处理可以指定要打印的份数。
为此,你需要开发一个传递给事件处理程序的自定义事件参数类,你应该使用下面那个代码段?A. public class PrintingArgs {private int copies;public PrintingArgs(int numberOfCopies) {this.copies = numberOfCopies;}public int Copies {get { return this.copies; }}}B. public class PrintingArgs : EventArgs {private int copies;public PrintingArgs(int numberOfCopies) {this.copies = numberOfCopies;}public int Copies {get { return this.copies; }}}C. public class PrintingArgs {private EventArgs eventArgs;public PrintingArgs(EventArgs ea) {this.eventArgs = ea;}public EventArgs Args {get { return eventArgs; }}}D. public class PrintingArgs : EventArgs {private int copies;}答案: B第2题你使用反射(Reflection)来获得方法MyMethod的信息。
你需要获取MyMethod方法是否在派生类中可以访问,你应该如何做?A. 访问MethodInfo 的IsAssembly 属性。
B. 访问MethodInfo 的IsVirtual属性。
C. 访问MethodInfo 的IsStatic属性。
D. 访问MethodInfo 的IsFamily属性。
答案: D你正在创建一个使用非托管资源的类。
这个类引用了使用托管资源的对象。
你需要确保使用这个类的用户在不需要类实例的时候能够够释放资源。
你应该做那三个工作?(每个答案是解决方案的一部分)A. 定义一个从WeakReference 继承的类。
B. 定义一个实现IDisposable 接口的类。
C. 创建一个类析构函数,调用其它对象的方法去释放托管资源。
D. 创建一个类析构函数,释放非托管资源E. 创建一个Dispose方法,调用System.GC.Collect 强制垃圾回收。
F. 创建一个Dispose方法,释放非托管资源并且调用其它对象的方法释放托管资源。
答案: B, D, F第4题你正对一个应用进行调试。
你需要找到引起异常的代码行。
请问,Exception类的哪个属性能达到这个目的?A. DataB. MessageC. StackTraceD. Source答案: C第5题你正在测试一个新开发的方法PersistToDB。
这个方法接收一个类型为EventLogEntry的参数,方法没有返回值。
你需要创建一段代码来帮助你测试这个方法。
这段代码必须从本地计算机的应用日志读取日志项然后传递日志项给PersistToDB方法。
要求,传递到PersistToDB方法的日志项必须是MySource源而且类型为错误或警告的日志。
你应该使用下面那个代码段?A. EventLog myLog = new EventLog(“Application”, “.”);foreach (EventLogEntry entry in myLog.Entries){if (entry.Source == "MySource"){PersistToDB(entry);}}B. EventLog myLog = new EventLog(“Application”, “.”);m yLog.Source = “MySource”;foreach (EventLogEntry entry in myLog.Entries){if (entry.EntryType == (EventLogEntryType.Error &EventLogEntryType.Warning)){PersistToDB(entry);}}C. EventLog myLog = new EventLog(“Application”, “.”);foreach (EventLogEntry entry in myLog.Entries){if (entry.Source == "MySource"){if (entry.EntryType == EventLogEntryType.Error ||entry.EntryType == EventLogEntryType.Warning){PersistToDB(entry);}}}D. EventLog myLog = new EventLog(“Application”, “.”);myLog.Source = “MySource”;foreach (EventLogEntry entry in myLog.Entries){if (entry.EntryType == EventLogEntryType.Error ||entry.EntryType == EventLogEntryType.Warning){PersistToDB(entry);}答案: C第6题你的应用使用两个名为threadOne和threadTwo的线程。
你需要修改代码使其只有threadTwo 执行完成才开始执行threadOne。
你应该如何做?A. 设置threadOne运行在低优先级。
B. 设置threadTwo运行在高优先级。
C. 使用WaitCallback 代理去同步线程。
D. 调用threadOne 的Sleep方法。
答案: C你是公司A的一个开发人员。
你创建了一个名为Company1的程序集。
Company1包含了一个public方法。
全局程序集中包含了另一个名为Company2的程序集。
你必须保证,public方法只能够被Company2调用。
你需要使用下面哪个权限类?A. GacIdentityPermissionB. PublisherIdentityPermissionC. DataProtectionPermissionD. StrongNameIdentityPermission答案: D第8题你创建了一个发送e-mail的应用。
一个名称为的SMTP服务器在本地子网是可用的。
为了测试应用,你使用源地址为me@,目标地址为you@。
你应该使用下面那个代码段去发送e-mail?A. MailAddress addrFrom =new MailAddress(“me@”, “Me”);MailAddress addrTo =new MailAddress(“you@”, “You”);MailMessage message = new MailMessage(addrFrom, addrTo);message.Subject = “Greetings!”;message.Body =“Test”;message.Dispose();B. string strSmtpClient = “”;string strFrom = “me@”;String strTo= “you@”;string strSubject = “Greetings!”;string strBody = “Test”;MailMessagemsg = new MailMessage(strFrom, strTo, strSubject, strSmtpClient);C. MailAddress addrFrom = new MailAddress(“me@”);MailAddress addrTo =newMailAddress(“you@”);MailMessage message = newMailMessage(addrFrom,addrTo);message.Subject = “Greetings!”;message.Body = “Test”;SmtpClient client = new SmtpClient(“”);client.Send(message);D. MailAddress addrFrom =new MailAddress(“me@”, “Me”);MailAddress addrTo = newMailAddress(“you@”, “You”);MailMessage message = newMailMessage(addrFrom, addrTo);message.Subject = “Greetings!”;message.Body =“Test”;SocketInformation info = new SocketInformation();Socket client = newSocket(info);System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();byte[] msgBytes = enc.GetBytes(message.ToString());client.Send(msgBytes);答案: C你正在开发一个自定义集合类。
你需要在你的类里创建一个方法而且能够保证你的方法的返回值是一个能够适合Foreach语句使用的类型。
你应该如何实现你的方法?A. 方法必须返回一个IEnumerator 或Ienumerable的类型。
B. 方法必须返回一个IComparable的类型。
C. 方法必须包含一个集合。
答案: A第10题你正在开发一个执行数学计算的应用。
你创建了一个类CalculationValues,并且写了一个操作CalculationValues的过程PerformCalculation。
你需要保证当计算被执行的时候,用户界面能够继续响应。
为此,你需要写一个代码段去调用PerformCalculation过程去达到目的,你应该使用下面那个代码段?A. private void PerformCalculation() {...} private void DoWork(){Calculation Values myValues = new Calculation Values();Thread newThread = new Thread(new ThreadStart(PerformCalculation));new Thread.Start(myValues);}B. private void PerformCalculation() {...} private void DoWork(){Calculation Values myValues = new Calculation Values();ThreadStart delStart = newThreadStart(PerformCalculation);Thread newThread = new Thread(delStart);if (newThread.IsAlive){newThread.Start(myValues);}}C. private void PerformCalculation (CalculationValues values) {...} private voidDoWork(){Calculation Values myValues = new Calculation Values();Application.DoEvents();PerformCalculation(myValues);Application.DoEvents();}D. private void PerformCalculation(object values) {...} private void DoWork(){Calculation Values myValues = new Calculation Values();Thread newThread = new Thread(new ParameterizedThreadStart(PerformCalculation));newThread.Start(myValues);}答案: D你写了如下一段代码public delegate void FaxDocs(object sender, FaxArgs args);你需要创建一个调用FaxDocs的事件,你应该使用那个代码段?A. pulic static event FaxDocs Fax;B. public static event Fax FaxDocs;C. public class FaxArgs : EventArgs {private string coverPageInfo;public FaxArgs(string coverInfo) {this.coverPageInfo = coverPageInfo;}public string CoverPageInformation {get {return this.coverPageInfo;}}}D. public class FaxArgs : EventArgs {private string coverPageInfo;public string CoverPageInformation {get {return this.coverPageInfo;}}}答案: A第12题你写如下的代码段去调用Win32 Application Programming Interface (API):string personName = “N?el”;string msg = “Welcome” + personName + “to club”!”;bool rc =User32API.MessageBox(0, msg, personName, 0);为了实现上面的调用,你需要定义一个方法原型,请问,你会采用那个代码段进行定义?A. [DllImport("user32", CharSet = CharSet.Ansi)]public static extern bool MessageBox(int hWnd,String text,String caption,uint type);} B. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet = CharSet.Ansi)]Public static extern bool MessageBox(int hWnd,[MarshalAs(UnmanagedType.LPWStr)]String text,[MarshalAs(UnmanagedType.LPWStr)]String caption,uint type);}C. [DllImport("user32", CharSet = CharSet.Unicode)]public static extern bool MessageBox(int hWnd,String text, String caption,uint type);} D. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet =CharSet.Unicode)]public static extern bool MessageBox(int hWnd,[MarshalAs(UnmanagedType.LPWStr)]String text,[MarshalAs(UnmanagedType.LPWStr)]String caption,uint type);}答案: C第13题你需要以字符串的形式返回isolated storage文件内容。