D. public class FaxArgs : EventArgs { private string coverPageInfo;
public string CoverPageInformation { get {return this.coverPageInfo;} }} Answer: A
解析:C和D肯定是错误的,声明了委托,需要用委托作为数据类型去声明事件,所以A和B中的一个是正确的。A是声明的委托类型,B是Fax类型的。是错误的。所以选A。
57. 您应该选择一个类,是从小的和大的集合中恢复关键项的最好的。 您应该选择哪一个类?
A. OrderedDictionary class 表示根据键/索引排序的键/值对的集合。 B. HybridDictionary class C. ListDictionary class 小集合。
D. Hashtable class 存储大集合时效率最高。 Answer: B
解析:看每一个类的解释,应该选用B,当集合数目大于10,小于10时,有所区别
58. 正确翻译:您正在创建一个名为Assembly1 的强名称程序集,该程序集将在多个应用程序中使用。在开发周期中, 将会频繁重新建立Assembly1。您需要确保该程序集在每次重新建立时都能与使用它的每个应用程序正常协同工作。
您需要配置在其中开发Assembly1 的计算机,以使每个应用程序都使用Assembly1 的最新版本。
您应该执行哪两项操作?(每个正确答案都仅给出了部分解决方案。请选择两个答案。) A. 创建一个DEVPATH 环境变量,该环境变量指向强名称程序集的版本输出目录。 B. 将以下XML 元素添加到计算机配置文件:
D. 将以下XML 元素添加到使用强名称程序集的每个应用程序的配置文件: E. 将以下XML 元素添加到使用强名称程序集的每个应用程序的配置文件: language=\ 59.您正在使用Microsoft Visual Studio 2005 IDE 检查一个返回string的方法的输出信息,您指定这个方法的输出给一个命名为fName的变量,您需要写一个代码片段打印下面这一行信息\如果fName的值不为”John”,您应该确定这个应该程序的代码持续的执行,您应该使用哪一个代码片段 A. Debug.Assert(fName == \ B. Debug.WriteLineIf(fName != \ C. if (fName != \{ Debug.Print(\FaileD. \ Debug.Print(fName); } D. if (fName != \{ Debug.WriteLine(\FaileD. \ Debug.WriteLine(fName); } Answer: B 60. 正确翻译:您创建一个由公司三个部门中的应用程序使用的类库。该库包含一个具有以下定义的Department 类。 public class Department { public string name; public string manager; } 每个应用程序使用一个自定义配置节在应用程序配置文件中存储特定于部门的值,如以下代码中所示。 您需要编写一个代码段,该代码段通过使用从应用程序配置文件中检索的字段值来创建Department 对象实例。 您应该使用哪个代码段? C. public class deptHandler :IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) { Department dept = new Department(); dept.name = section.SelectSingleNode(\ dept.manager = section.SelectSingleNode(\return dept; } } D. public class deptHandler :IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) { Department dept = new Department(); dept.name = section.Attributes[\ dept.manager = section.Attributes[\return dept; } } Answer: C 解析:从题目中看需要返回一个对象值,所以必须要声明一个有返回值且返回值类型为对象类型的方法,可以排除答案A和B。C和D的区别就在于使用section的哪个方法来取得值了。从MSDN上可以看到,XMLNode就没有Attributes[“name”]的用法。所以应选C。SelectSingleNode方法的功能,选择匹配 XPath 表达式的第一个 XmlNode。 61.您测试名为PersistToDB的一个新开发的方法。 这个方法接受类型EventLogEntry的参数 。 这个方法不返回值。 您需要编写一段代码帮助您来测试这个方法。 代码段必须从本地计算机应用程序中读词条并且通过PersistToDB方法传递词条。代码块必须通过事件类型错误或警告从源MySource到PersistToDB方法。 您应该使用哪个代码段? A. EventLog myLog = new EventLog(\ foreach (EventLogEntry entry in myLog.Entries) { if (entry.Source == \ } B. EventLog myLog = new EventLog(\ myLog.Source = \ foreach (EventLogEntry entry in myLog.Entries) { if (entry.EntryType == (EventLogEntryType.Error & EventLogEntryType.Warning)) { PersistToDB(entry); } } C. EventLog myLog = new EventLog(\ foreach (EventLogEntry entry in myLog.Entries) { if (entry.Source == \ {if (entry.EntryType == EventLogEntryType.Error | entry.EntryType == EventLogEntryType.Warning) { PersistToDB(entry); } } } D. EventLog myLog = new EventLog(\ myLog.Source = \ foreach (EventLogEntry entry in myLog.Entries) {if (entry.EntryType == EventLogEntryType.Error |entry.EntryType == EventLogEntryType.Warning) {PersistToDB(entry); } 答案: C 62.您正在开发的应用程序接收异步事件。您创建一个WqlEventQuery实例指向 特定的事件和事件条件,该申请必须作出反应。您也创建了ManagementEventWatcher实例为了订阅查询相匹配的事件。您需要确定的其他行动之前,您必须执行的应用程序可以接收异步事件。这两项行动应 您执行? (每正确回答提出解决办法的一部分。请选择两项。 ) A. 通过调用Start方法的ManagementEventWatcher开始监听事件 B. 为事件设置一个监听者使用ManagementEventWatcher的EventArrived 事件 C. 使用ManagementEventWatcher事件的WaitForNextEvent 方法等待这个事件 D. 建立一个事件句柄类,其中的方法用来接收ObjectReadyEventArgs 传递的参数 E.为事件设置一个监听者用ManagementEventWatcher来停止事件 答案: A, B 63.您要测试的方法,检查运行过程。此方法返回一个被加载在C:\\TestApps\\Process1.exe进程中包含名称和全路径的所有模块的ArrayList,。您需要加载的模块列表中的进程,您用下面的哪个代码? A. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules; procs = Process.GetProcesses(@\ if (procs.Length > 0) {modules = procs[0].Modules; foreach (ProcessModule mod in modules) {ar.Add(mod.ModuleName); }} B. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules; procs = Process.GetProcesses(@\ if (procs.Length > 0) { modules = procs[0].Modules; foreach (ProcessModule mod in modules) {ar.Add(mod.ModuleName); }} C. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules; procs = Process.GetProcessesByName(@\ if (procs.Length > 0) { modules = procs[0].Modules; foreach (ProcessModule mod in modules) {ar.Add(mod.FileName); }} D. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules; procs = Process.GetProcessesByName(@\ if (procs.Length > 0) { modules = procs[0].Modules; foreach (ProcessModule mod in modules) {ar.Add(mod.FileName); }} 答案: C 解析:题目考察的是得到指定进程的进程资源,所以选择GetProcessesByName(). 排除答案AB。D的路径名写错了。所以选C 64. 您创建了一个应用程序,存储信息为您的居住在不同区域的客户。在您的应用程序中的作用是发展中的国家的工具。您需要收集您位于加拿大的客户的区域信息,该段代码应该如何使用:? A. foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) { // Output the region information...} B. CultureInfo cultureInfo = new CultureInfo(\ C. RegionInfo regionInfo = new RegionInfo(\ D. RegionInfo regionInfo = new RegionInfo(\ { // Output the region information...} 答案: C 65.您正在为一个客户进行财务报表。您的客户在美国墨西哥办事处有一个主要的办公室。您必须确保当用户在办公室产生的报告,当前的日期显示在墨西哥西班牙语格式。该代码段应该使用? A. DateTimeFormatInfo dtfi = new CultureInfo(\ DateTime dt = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day); string dateString = dt.ToString(dtfi.LongDatePattern); B. Calendar cal = new CultureInfo(\