|
u must visit itcertkeys.com u can get success thanks buddy
|
Question 1. You write the following custom exception class named CustomException. public class CustomException : ApplicationException { public static int COR_E_ARGUMENT = unchecked((int)0x80070057); public CustomException(string msg) : base(msg) { HResult = COR_E_ARGUMENT; }} You need to write a code segment that will use the CustomException class to immediately return control to the COM caller. You also need to ensure that the caller has access to the error code. Which code segment should you use? A. return Marshal.GetExceptionForHR ( CustomException.COR_E_ARGUMENT); B. return CustomException.COR_E_ARGUMENT; C. Marshal.ThrowExceptionForHR( CustomException.COR_E_ARGUMENT); D. throw new CustomException ("Argument is out of bounds"); Answer: D Question 2. You create a class library that is used by applications in three departments of Company.com. The library contains a Department class with the following definition. public class Department { public string name; public string manager; } Each application uses a custom configuration section to store department-specific values in the application configuration file as shown in the following code.You need to write a code segment that creates a Department object instance by using the field values retrieved from the application configuration file. Which code segment should you use? A. public class deptElement : ConfigurationElement { protected override void DeserializeElement( XmlReader reader, bool serializeCollectionKey) { Department dept = new Department(); dept.name = ConfigurationManager.AppSettings["name"]; dept.manager = ConfigurationManager.AppSettings["manager"]; return dept; } } B. public class deptElement: ConfigurationElement { protected override void DeserializeElement( XmlReader reader, bool serializeCollectionKey) { Department dept = new Department(); dept.name = reader.GetAttribute("name"); dept.manager = reader.GetAttribute("manager"); } } C. public class deptHandler : IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) { Department dept = new Department(); dept.name = section.SelectSingleNode("name").InnerText; dept.manager = section.SelectSingleNode("manager").InnerText; 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["name"].Value; dept.manager = section.Attributes["manager"].Value; return dept; } } Answer: C Question 3. You write the following custom exception class named CustomException. public ref class CustomException : ApplicationException {public: literal int COR_E_ARGUMENT = (int)0x80070057; CustomException(String^ msg) : ApplicationException(msg) { HResult = COR_E_ARGUMENT; }}; You need to write a code segment that will use the CustomException class to immediately return control to the COM caller. You also need to ensure that the caller has access to the error code. Which code segment should you use? A. return Marshal::GetExceptionForHR( CustomException::COR_E_ARGUMENT); B. return CustomException::COR_E_ARGUMENT; C. Marshal::ThrowExceptionForHR( CustomException::COR_E_ARGUMENT); D. throw gcnew CustomException("Argument is out of bounds"); Answer: D Question 4. You are writing a method to compress an array of bytes. The array is passed to the method in a parameter named document. You need to compress the incoming array of bytes and return the result as an array of bytes. Which code segment should you use? A. MemoryStream^ strm = gcnew MemoryStream(document); DeflateStream^ deflate = gcnew DeflateStream(strm, CompressionMode::Compress); array Hardware Company ^ result = gcnew array (document->Length); deflate->Write(result, 0, result->Length); return result; B. MemoryStream^ strm = gcnew MemoryStream(document); DeflateStream^ deflate = gcnew DeflateStream(strm, CompressionMode::Compress); deflate->Write(document, 0, document->Length); deflate->Close(); return strm->ToArray(); C. MemoryStream^ strm = gcnew MemoryStream(); DeflateStream^ deflate = gcnew DeflateStream(strm,CompressionMode::Compress); deflate->Write(document, 0, document->Length); deflate->Close(); return strm->ToArray(); D. MemoryStream^ inStream = gcnew MemoryStream(document); DeflateStream^ deflate = gcnew DeflateStream(inStream, CompressionMode::Compress); MemoryStream^ outStream = gcnew MemoryStream() int b; while ((b = deflate->ReadByte()) != -1) { outStream->WriteByte((Byte)b); } return outStream->ToArray(); Answer: C Question 5. You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You need to ensure that the dictionary is type safe. Which code segment should you use? A. public ref class MyDictionary : public Dictionary {}; B. public ref class MyDictionary : public Hashtable{}; C. public ref class MyDictionary : public IDictionary{}; D. public ref class MyDictionary{}; Dictionary t = gcnew Dictionary (); MyDictionary dictionary = (MyDictionary)t; Answer: A Question 6. You develop a service application named FileService. You deploy the service application to multiple servers on your network. You implement the following code segment. (Line numbers are included for reference only.) 01 public : 02 void StartService(String^ serverName){ 03 04 ServiceController^ crtl = gcnew 05 ServiceController("FileService"); 06 if (crtl->Status == ServiceControllerStatus::Stopped){} 07 } You need to develop a routine that will start FileService if it stops. The routine must start FileService on the server identified by the serverName input parameter. Which two lines of code should you add to the code segment? (Each correct answer presents part of the solution. Choose two.) A. Insert the following line of code between lines 03 and 04:crtl.ServiceName = serverName; B. Insert the following line of code between lines 03 and 04:crtl.MachineName = serverName; C. Insert the following line of code between lines 03 and 04:crtl.Site.Name = serverName; D. Insert the following line of code between lines 04 and 05:crtl.Continue(); E. Insert the following line of code between lines 04 and 05:crtl.Start(); F. Insert the following line of code between lines 04 and 05:crtl.ExecuteCommand(0); Answer: B, E Question 7. You are loading a new assembly into an application. You need to override the default evidence for the assembly. You require the common language runtime (CLR) to grant the assembly a permission set, as if the assembly were loaded from the local intranet zone. You need to build the evidence collection. Which code segment should you use? A. Evidence^ evidence = gcnew Evidence(Assembly::GetExecutingAssembly()->Evidence); B. Evidence^ evidence = gcnew Evidence(); evidence->AddAssembly(gcnew Zone(SecurityZone::Intranet)); C. Evidence^ evidence = gcnew Evidence(); evidence->AddHost(gcnew Zone(SecurityZone::Intranet)); D. Evidence^ evidence = gcnew Evidence(AppDomain::CurrentDomain->Evidence); Answer: C Question 8. You are developing an application for a client residing in Hong Kong. You need to display negative currency values by using a minus sign. Which code segment should you use? A. NumberFormatInfo^ culture = gcnew CultureInfo("zh-HK")::NumberFormat; culture->NumberNegativePattern = 1; return numberToPrint->ToString("C", culture); B. NumberFormatInfo^ culture = gcnew CultureInfo("zh-HK")::NumberFormat; culture->CurrencyNegativePattern = 1; return numberToPrint->ToString("C", culture); C. CultureInfo^ culture = gcnew CultureInfo("zh-HK"); return numberToPrint->ToString("-(0)", culture); D. CultureInfo^ culture = gcnew CultureInfo("zh-HK"); return numberToPrint->ToString("()", culture); Answer: B Question 9. You are creating a Web Form. The Web Form allows users to rename or delete products in a list. You create a DataTable named dtProducts that is bound to a GridView. DataTable has the following four rows. dtProducts.Rows(0)("ProductName") = "Soap" dtProducts.Rows(1)("ProductName") = "Book" dtProducts.Rows(2)("ProductName") = "Computer" dtProducts.Rows(3)("ProductName") = "Spoon" dtProducts.AcceptChanges() The user utilizes a Web Form to delete the first product. You need to set the RowStateFilter property of the DataTables DefaultView so that only products that have not been deleted are shown. To which value should you set the DataTabless DefaultView.RowStateFilter? A. DataViewRowState.ModifiedOriginal B. DataViewRowState.ModifiedCurrent C. DataViewRowState.CurrentRows D. DataViewRowState.Added Answer: C Question 10. You create a Web Form that contains a TreeView control. The TreeView control allows users to navigate within the Marketing section of your Web site. The following XML defines the site map for your site. You need to bind the TreeView control to the site map data so that users can navigate only within the Marketing section. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.) A. Add a SiteMapDataSource control to the Web Form and bind the TreeView control to it. B. Add a SiteMapPath control to the Web Form and bind the TreeView control to it. C. Embed the site map XML within the SiteMap node of a Web.sitemap file. D. Embed the site map XML within the AppSettings node of a Web.config file. E. Set the StartingNodeUrl property of the SiteMapDataSource control to ~/Marketing.aspx. F. Set the SkipLinkText property of the SiteMapPath control to Sales. Answer: A, C, E
Copyright © 2004 CertsBraindumps.com Inc. All rights reserved.