MCP-070-536

40 Questions | Total Attempts: 56

SettingsSettingsSettings
Microsoft Certification Quizzes & Trivia

C# Related Question


Related Topics
Questions and Answers
  • 1. 
     Certkiller .com uses Visual Studio.NET 2005 as its application development platform. You are in the process of storing numerical values up to 2,100,000,000 into a variable and may require storing negative values using a .NET Framework 2.0 application. You are required to optimize memory usage What should you do?
    • A. 

      Int32

    • B. 

      UInt16

    • C. 

      UInt32

    • D. 

      Int16

  • 2. 
     You are currently in the process of creating a class that stores data about Certkiller .com's customers. Certkiller .com customers are assigned unique identifiers and various characteristics that may include aliases, shipping instructions, and sales comments. These characteristics can change in both size and data type. You start by defining the Customer class as shown below: public class Customer { private int custID; private ArrayList attributes; public int CustomerID { get {return custID;} } public Customer (int CustomerID) { this.custID = CustomerID; this.attributes = new ArrayList (); } public void AddAttribute (object att) { attributes.Add (att); } } You have to create the FindAttribute method for locating attributes in Customer objects no matter what the data type is. You need to ensure that the FindAttribute method returns the attribute if found, and you also need to ensure type-safety when returning the attribute. What should you do?
    • A. 

      Use the following code to declare the FindAttribute method: public T FindAttribute (T att) { //Find attribute and return the value }

    • B. 

      Use the following code to declare the FindAttribute method: public object FindAttribute (object att) { //Find attribute and return the value }

    • C. 

      Use the following code to declare the FindAttribute method: public T FindAttribute (T att) { //Find attribute and return the value }

    • D. 

      Use the following code to declare the FindAttribute method: public string FindAttribute (string att) { //Find attribute and return the value }

  • 3. 
    Certkiller .com uses Visual Studio.NET 2005 as its application development platform. You are developing a .NET Framework 2.0 application used to store a type-safe list of names and e-mail addresses. The list will be populated all at ones from the sorted data which means you well not always need to perform insertion or deletion operations on the data. You are required to choose a data structure that optimizes memory use and has good performance. What should you do?
    • A. 

      The System.Collections.Generic.SortedList class should be used

    • B. 

      The System.Collections.HashTable class should be used

    • C. 

      The System.Collections.Generic.SortedDictionary class should be used

    • D. 

      The System.Collections.SortedList class should be used

  • 4. 
    You are currently in the process of reviewing an application that was created by a fellow developer. The application that you are reviewing includes a declaration for a collection named EmployeeList, which stores Employee objects. The declaration is shown below: public class EmployeeList : Enumerator, IEnumerable { // Class implementation } You require the ability to iterate through the EmployeeList with minimum development effort. What should you do?
    • A. 

      Utilize the switch statement

    • B. 

      Utilize the dowhile statement

    • C. 

      Utilize the foreach statement

    • D. 

      Utilize the if statement

  • 5. 
     Certkiller .com has been contracted to develop an application for the local bank. You have been given the responsibility of creating this application and need to store each transaction record, which is identified using a complex transaction identifier, in memory. The bank informs you that the total amount of transaction records could reach 200 per day. To achieve this, you decide to utilize one of the existing collection classes in the .NET 2.0 class library. You need to ensure that you the collection class you select is the most efficient one for storing transaction records. What should you do?
    • A. 

      Select the ListDictionary collection class.

    • B. 

      Select the HashTable collection class.

    • C. 

      Select the Queue collection class.

    • D. 

      Select the StringCollection collection class.

  • 6. 
     Certkiller .com wants you to develop an application that stores and retrieves client information by means of a unique account number. You create a custom collection class, which implements the IDictionary interface, named ClientDictionary. The following code have been included into the new application. //Create Client objects Client c1 = new Client ("AReid", "Andy Reid", Status.Current); Client c2 = new Client ("DAustin", "Dean Austin", Status.New); //Create ClientDictionary object IDictionary cData = new ClientDictionary (); cData.Add ("10001", c1); cData.Add ("10002", c2); You use the same method to add other Client objects to the collection. You need to ensure that you are able to retrieve client information associated with the account number 10111. What should you do?
    • A. 

      Use the following code: Client foundClient; foundClient = (Client) cData.Find ("10111");

    • B. 

      Use the following code: Client foundClient; if (cData.Contains ("10111")) foundClient = cData ["10111"];

    • C. 

      Use the following code: Client foundClient; if (cData.Contains ("10111")) foundClient = (Client) cData ["10111"];

    • D. 

      Use the following code: Client foundClient; foreach (string key in cData.Keys { if (key == "10111") foundClient = (Client) cData.Values ["10111"]; }

  • 7. 
    You are developing an application that makes use of a Queue class object named MyQueue. This Queue class object will be used to store messages sent by the user during application run time. You would like to access the message at the beginning of the queue, prior to processing the user messages, without removing it. What should you do?
    • A. 

      Use the Enqueue method of the MyQueue object.

    • B. 

      Use the Contains method of the MyQueue object.

    • C. 

      Use the Dequeue method of the MyQueue object.

    • D. 

      Use the Peek method of the MyQueue object.

  • 8. 
    Certkiller .com wants you to develop an application that stores and retrieves employee information by means of a unique staff number. You create a custom collection class, which implements the type-safe IDictionary interface. This collection class is named EmployeeCollection, and is defined using the following code. public class EmployeeCollection : IDictionary { // Implementation code } You need to ensure that an EmployeeCollection object is instantiated and that Employee objects are added to it. What should you do?
    • A. 

      Use the following code: Employee e1, e2; e1 = new Employee (1001, "Andy Reid", "Manager"); e2 = new Employee (1002, "Kara Lang", "Sales Engineer"); EmployeeCollection eData = new EmployeeCollection(); eData.Add (new KeyValuePair (e1.ID, e1)); eData.Add (new KeyValuePair (e2.ID, e2));

    • B. 

      . Use the following code: Employee e1, e2; e1 = new Employee (1001, "Andy Reid", "Manager"); e2 = new Employee (1002, "Kara Lang", "Sales Engineer"); EmployeeCollection eData = new EmployeeCollection(); eData.Add ((string) e1.ID, e1); eData.Add ((string) e2.ID, e2);

    • C. 

      Use the following code: Employee e1, e2; e1 = new Employee (1001, "Andy Reid", "Manager"); e2 = new Employee (1002, "Kara Lang", "Sales Engineer"); EmployeeCollection eData = new EmployeeCollection(); eData.Add (e1.ID, e1); eData.Add (e2.ID, e2);

    • D. 

      Use the following code: Employee e1, e2; e1 = new Employee (1001, "Andy Reid", "Manager"); e2 = new Employee (1002, "Kara Lang", "Sales Engineer"); EmployeeCollection eData = new EmployeeCollection(); eData.Add (new KeyValuePair (e1.ID, e1)); eData.Add (new KeyValuePair (e2.ID, e2));

  • 9. 
    You are developing a collection class named ClientCollection, which is to be used for storing the names of Certkiller .com's clients that are situated in various geographical areas. These client names are represented by the Client class. You are planning to create a method named SortClients in the ClientCollection class to arrange Client objects in ascending order. You need to ensure that the appropriate interface is implemented by the Client class to allow sorting. What interface should be used?
    • A. 

      IDictionary

    • B. 

      IComparable

    • C. 

      IComparer

    • D. 

      IEqualityComparer

  • 10. 
    You have been given the responsibility of creating a class named CalcSalary that will determine the salaries of Certkiller .com's staff. The CalcSalary class includes methods to increment and decrement staff salaries. The following code is included in the CalcSalary class: public class CalcSalary { // for promotions public static bool IncrementSalary (Employee Emp, double Amount) { if (Emp.Status == QuarterlyReview.AboveGoals) Emp.Salary += Amount; return true; } else return false; } //for demotions public static bool DecrementSalary (Employee Emp, double Amount) { if (Emp.Status == QuarterlyReview.AboveGoals) Emp.Salary -= Amount; return true; } else return false; } } You would like to invoke the IncrementSalary and DecrementSalary methods dynamically at runtime from the sales manager application, and decide to create a delegate named SalaryDelegate to invoke them. You need to ensure that you use the appropriate code to declare the SalaryDelegate delegate. What is the correct line of code?
    • A. 

      Public delegate bool Salary (Employee Emp, double Amount);

    • B. 

      Public bool Salary (Employee Emp, double Amount);

    • C. 

      public event bool Salary (Employee Emp, double Amount);

    • D. 

      Public delegate void Salary (Employee Emp, double Amount);

  • 11. 
    You have recently created a Windows service application and need to define a Windows service class. What should you do?
    • A. 

      Use the following code: public class TestService : System.ServiceProcess.WindowsService { //Implementation details }

    • B. 

      Use the following code: public class TestService : System.ServiceProcess.IWindowsService { //Implementation details }

    • C. 

      Use the following code: public class TestService : System.ServiceProcess.ServiceBase { //Implementation details }

    • D. 

      Use the following code: public class TestService : System.ServiceProcess.IService { //Implementation details }

  • 12. 
    Certkiller .com has asked you to develop an application that monitors and controls the activities of a Windows service. You need to use the appropriate class to meet Certkiller .com's requirements. What should you do?
    • A. 

      Use the ServiceBase class.

    • B. 

      Use the ServiceInstaller class.

    • C. 

      Use the ServiceManager class.

    • D. 

      Use the ServiceController class.

  • 13. 
    You have recently created a multithreaded application to manage Certkiller .com's inventory system. The fulfillment task has to be executed on a regular basis, while other tasks are performed in the application. The task does not need any input to start. You are required to create and start the fulfillment thread using the appropriate code. What code should you use?
    • A. 

      ThreadStart work = new ThreadStart (Fulfill); Thread thFulfill = new Thread (work);

    • B. 

      ParameterizedThreadStart work = new ParameterizedThreadStart (Fulfill); Thread thFulfill = new Thread (work);

    • C. 

      ThreadStart work = new ThreadStart (Fulfill); Thread thFulfill = new Thread (work); thFulfill.Start ();

    • D. 

      ParameterizedThreadStart work = new ParameterizedThreadStart (Fulfill); Thread thFulfill = new Thread (work); thFulfill.Start ();

  • 14. 
    You have recently created an application that includes the code shown below. public delegate stringGetFileContentsDel (); public string GetFileContents () { //Process file and return results } You now need to invoke the GetFileContents method asynchronously. You have to ensure that the code you use to invoke the GetFileContents method will continue to process other user instructions, and displays the results as soon as the GetFileContents method finishes processing. What should you do?
    • A. 

      Use the following code: GetFileContentsDel delAsync = new GetFileContentsDel (GetFileContents); IAsyncResult result = delAsync.BeginInvoke (null, null); while (!result.IsCompleted) { //Process other user instructions } string strFile = delAsync.EndInvoke (result);

    • B. 

      Use the following code: GetFileContentsDel delAsync = new GetFileContentsDel (GetFileContents); string strFile = delAsync.Invoke ();

    • C. 

      Use the following code: string strFile = GetFileContents.Invoke ();

    • D. 

      Use the following code: GetFileContentsDel delAsync = new GetFileContentsDel (GetFileContents); IAsyncResult result = delAsync.BeginInvoke (null, null); //Process other user instructions string strFile = delAsync.EndInvoke (result);

  • 15. 
    You have recently created an application domain for Certkiller .com. A few weeks later you are asked to retrieve information from this application domain, which is the current application domain. What can you do to achieve this objective? (Choose two)
    • A. 

      Use the following code: AppDomain appInfo = ApplicationDomain.Current;

    • B. 

      Use the following code: AppDomain appInfo = AppDomain.CurrentDomain ();

    • C. 

      Use the following code: AppDomain appInfo = Thread.GetDomain ();

    • D. 

      Use the following code: AppDomain appInfo = MainThread.GetDomain ();

  • 16. 
    You are required to dynamically load assemblies into a custom child application domain. You need to ensure that the assemblies loaded into the child application domain have the same permissions as the applications that are accessed across the local intranet. What should you do?
    • A. 

      Use the following code to create the child application domain: Evidence childEvidence = new Evidence (new object [ ] { SecurityZone.Intranet }, null); AppDomain.CreateDomain ("ChildDomain", childEvidence);

    • B. 

      Use the following code to create the child application domain: AppDomain.CreateDomain ("ChildDomain", SecurityZone.Intranet);

    • C. 

      Use the following code to create the child application domain: AppDomain domain = new AppDomain ("ChildDomain", SecurityZone.Intranet);

    • D. 

      Use the following code to create the child application domain: Evidence childEvidence = new Evidence (new object [ ] { SecurityZone.Intranet }, null); AppDomain domain = new AppDomain ("ChildDomain", childEvidence);

  • 17. 
    You are required to dynamically load assemblies into an application domain. You are using the Load method of the AppDomain class. What types of files can you this use method for?
    • A. 

      Library application files (.dll).

    • B. 

      All assembly files, no matter what there file extensions are.

    • C. 

      Application configuration files (.config).

    • D. 

      Standalone application files (.exe).

  • 18. 
    You are in the process of creating an application for Certkiller .com's Human Resources department that tracks employee benefits. You have to store current employee data without recompiling the application. You elect to store this employee data as a custom section in the application configuration file. The relevant portion of the application configuration file is shown in the following exhibit: You want to use the .NET 2.0 Configuration API to access the custom section. You need to ensure that programmatic access of the EmployeeSection element is enabled. What should you do? (Choose two)
    • A. 

      Create a custom section handler class that inherits the ConfigurationSection interface.

    • B. 

      Add a section element to the EmployeeSection element of the application configuration file.

    • C. 

      Create a custom section handler class that implements the IConfigurationSectionHandler interface.

    • D. 

      Add an EmployeeSection element to the configSections element of the application configuration file.

    • E. 

      Add a section element to the configSections element of the application configuration file.

  • 19. 
    You have recently created and deployed an application using the .NET 1.1 CLR to all Certkiller .com users. After a Certkiller .com administrator updates all user computers with the .NET 2.0 CLR, you run preliminary tests and find that the application you created using the .NET 1.1 CLR is not compatible with the .NET 2.0 CLR. You need to ensure that the application can be run with the .NET 1.1 CLR. What should you do?
    • A. 

      Use the following element in the application configuration file:

    • B. 

      Use the following element in the application configuration file:

    • C. 

      Use the following element in the application configuration file:

    • D. 

      Use the following element in the application configuration file:

  • 20. 
    You have recently created a business application that references another strong-named assembly named library.dll, and deployed it to all Certkiller .com users. Subsequent to testing the applications performance, you elect to upgrade the assembly's version to 1.1.0.0. You need to ensure that the new version of will not affect any of Certkiller .com's current users by adding the appropriate element to the assemblyBinding element in the application configuration file. What element should you add?
    • A. 

    • B. 

    • C. 

    • D. 

  • 21. 
    You are required to retrieve and display the names of all processes that are currently running in memory. What should you do?
    • A. 

      Use the following code: foreach (Process curProcess in Process.GetSystemProcesses ()) Console.WriteLine (curProcess.ProcessName);

    • B. 

      Use the following code: foreach (Process curProcess in Process.GetAllProcesses ()) Console.WriteLine (curProcess.ProcessName);

    • C. 

      Use the following code: foreach (Process curProcess in Process.GetProcesses ()) Console.WriteLine (curProcess.ProcessName);

    • D. 

      Use the following code: foreach (Process curProcess in Thread.GetProcesses ()) Console.WriteLine (curProcess.ProcessName);

  • 22. 
    To get information on a specific method named myMethod, you use Reflection. You need to find out if myMethod can be accessed from a derived class. Which of the following properties should you call from the myMethod class?
    • A. 

      Call the IsAssembly property.

    • B. 

      Call the IsVirtual property.

    • C. 

      Call the IsStatic property.

    • D. 

      Call the IsFamily property.

  • 23. 
    • A. 

      Define the existing class so that it inherits from the WeakReference class.

    • B. 

      Define the existing class so that it applies the IDisposable interface.

    • C. 

      Create a new class destructor which calls methods on other objects to release the managed resources.

    • D. 

      Create a new class destructor that releases the unmanaged resources.

    • E. 

      Create a new Dispose method that releases unmanaged resources and which also calls methods on other objects to release the managed resources.

  • 24. 
    You are developing a debug build of an existing application. You want to locate a specific line of code which resulted in the exception occurring. Choose the property of the Exception class that you should use to accomplish the task.
    • A. 

      Data property

    • B. 

      Message property

    • C. 

      StackTrace property

    • D. 

      Source property

  • 25. 
    You need to modify the code of an application. The application uses two threads named thread A and thread B. You want thread B to complete executing before thread A starts executing. How will you accomplish the task?
    • A. 

      Define thread A to run at a lower priority.

    • B. 

      Define thread B to run at a higher priority.

    • C. 

      Implement the WaitCallback delegate to synchronize the threads.

    • D. 

      Call the Sleep method of thread A.

    • E. 

      Call the SpinLock method of thread A.

  • 26. 
    You must specify a class which is optimized for key-based item retrieval from collections. Your class must cater for key-based item retrieval for small and large collections. Which of the following class types should you specify?
    • A. 

      Select the OrderedDictionary class.

    • B. 

      Select the HybridDictionary class.

    • C. 

      Select the ListDictionary class.

    • D. 

      Select the Hashtable class.

  • 27. 
    You are working on an application and want to use platform invoke services to call an unmanaged function from managed code. How will you accomplish the task?
    • A. 

      Create a class to store DLL functions. Create prototype methods by using the managed code.

    • B. 

      Use COM to register the assembly. Reference the managed code from COM.

    • C. 

      Export a type library for the managed code.

    • D. 

      Import a type library as an assembly. Create instances of COM object.

  • 28. 
    You are developing a strong-named assembly named Certkiller Ass3. Certkiller Ass3 will be used by multiple applications. You plan to frequently rebuild Certkiller Ass3 during the development lifecycle. Whenever Certkiller Ass3 is rebuilt, you must ensure that it works as expected with all applications that will use it. You must configure the computer that you are using to create Certkiller Ass3 so that all applications reference the latest build of Certkiller Ass3. Choose the two actions which you should perform to achieve your goal. Each correct answer presents only part of the complete solution.
    • A. 

      Create a DEVPATH environment variable which points to the build output directory for Certkiller Ass3.

    • B. 

      Include this XML element in the computer configuration file:

    • C. 

      Include this XML element in the computer configuration file:

    • D. 

      Include this XML element in the configuration file of each application that must use Certkiller Ass3:

    • E. 

      Include this XML element in the configuration file of each application that must use Certkiller Ass3:

  • 29. 
    You are developing a new class named Certkiller Class. Certkiller Class contains a method named Certkiller Method, and a number of child objects which are serializable. Certkiller Method will execute actions on all child objects. You want make to certain that Certkiller Method is applied whenever Certkiller Class and its associated child objects are rebuilt. Choose the two actions which you should perform next? Each correct answer presents only part of the complete answer.
    • A. 

      Apply the OnDeserializing attribute to the Certkiller Method method.

    • B. 

      Define Certkiller Class to implement the IDeserializationCallback interface.

    • C. 

      Apply the OnSerialized attribute to Certkiller Method.

    • D. 

      Create a GetObjectData method that calls Certkiller Method.

    • E. 

      Create an OnDeserialization method that calls Certkiller Method.

  • 30. 
    You are working on method to call a COM component, and must use declarative security to explicitly request the runtime to perform a full stack walk. Before allowing any callers to execute the method, they must have the required level of trust for COM interop. Choose the attribute that should be used on the method.
    • A. 

      Use this attribute: [SecurityPermission( SecurityAction::Demand, Flags=SecurityPermissionFlag::UnmanagedCode)]

    • B. 

      Use this attribute: [SecurityPermission( SecurityAction::LinkDemand, Flags=SecurityPermissionFlag::UnmanagedCode)]

    • C. 

      Use this attribute: [SecurityPermission( SecurityAction::Assert, Flags = SecurityPermissionFlag::UnmanagedCode)]

    • D. 

      Use this attribute: [SecurityPermission( SecurityAction::Deny, Flags = SecurityPermissionFlag::UnmanagedCode)]

  • 31. 
    You are creating a new custom event handler that will be set up to automatically print all open documents. The custom event handler must also assist in identifying how many document copies must be printed. You must determine which custom event arguments class to pass as a parameter to the custom event handler. Choose the code segment which you should use to accomplish this task.
    • 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; }

  • 32. 
    You are working on a new method named PersistToDB. PersistToDB returns no value, and takes the EventLogEntry parameter type. You must create the specific code segment which will enable you to test whether the new method works as expected. The code segment you use must be able to access entries from the application log of local computers, and must then pass only specific entries on to PersistToDB. The relevant entries to be passed to PersistToDB are Error events and Warning events from the source named mySource. Choose the code segment which would achieve your goal in these circumstances.
    • A. 

      EventLog myLog = new EventLog("Application", "."); foreach (EventLogEntry entry in myLog.Entries) { if (entry.Source == "MySource") { PersistToDB(entry); }}

    • B. 

      EventLog myLog = new EventLog("Application", "."); myLog.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); }

  • 33. 
    You have created a new application named Certkiller App05. Certkiller App05 is configured to forward an e-mail message. The SMTP server on the local subnet is named Certkiller -SR31. You want to test Certkiller App05. You decide to use a source address of [email protected] Certkiller .com; and a target address of [email protected] Certkiller .com. Choose the code segment which you should use to test whether Certkiller App05 sends e-mail messages.
    • A. 

      MailAddress addrFrom = new MailAddress("[email protected] Certkiller .com", "Mia"); MailAddress addrTo = new MailAddress("[email protected] Certkiller .com", "Dest"); MailMessage message = new MailMessage(addrFrom, addrTo); message.Subject = "Hello"; message.Body = "Test Message"; message.Dispose();

    • B. 

      String strSmtpClient = " Certkiller -SR31"; string strFrom = " [email protected] Certkiller .com"; string strTo = "[email protected] Certkiller .com"; string strSubject = "Hello"; string strBody = "Test Message"; MailMessage msg = new MailMessage(strFrom, strTo, strSubject, strSmtpClient);

    • C. 

      MailAddress addrFrom = new MailAddress("[email protected] Certkiller .com"); MailAddress addrTo = new MailAddress("[email protected] Certkiller .com"); MailMessage message = new MailMessage(addrFrom, addrTo); message.Subject = " Hello"; message.Body = "Test Message "; SmtpClient client = new SmtpClient(" Certkiller -SR31"); client.Send(message);

    • D. 

      MailAddress addrFrom = new MailAddress("[email protected] Certkiller .com", "Mia"); MailAddress addrTo = new MailAddress("[email protected] Certkiller .com", "Dest"); MailMessage message = new MailMessage(addrFrom, addrTo); message.Subject = " Hello"; message.Body = " Test Message"; SocketInformation info = new SocketInformation(); Socket client = new Socket(info); System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); byte[] msgBytes = enc.GetBytes(message.ToString()); client.Send(msgBytes);

  • 34. 
    You are working on a new application named Certkiller App20. Certkiller App20 is configured to perform a series of mathematical calculations. You create a class named Certkiller AppClass and create a procedure named Certkiller AppSP. Certkiller AppSP must execute on an instance of the class. You must configure the application's user interface so that it continues to respond for the duration that calculations are performed. You must write the code segment for calling the Certkiller AppSP procedure which will accomplish your objective. Choose the code segment which you should use.
    • A. 

      Private void Certkiller AppSP() {...} private void DoWork(){ Certkiller AppClass myValues = new Certkiller AppClass(); Thread newThread = new Thread( new ThreadStart( Certkiller AppSP)); newThread.Start(myValues); }

    • B. 

      Private void Certkiller AppSP() {...} private void DoWork(){ Certkiller AppClass myValues = new Certkiller AppClass(); ThreadStart delStart = new ThreadStart( Certkiller AppSP); Thread newThread = new Thread(delStart); if (newThread.IsAlive) {newThread.Start(myValues); }}

    • C. 

      Private void Certkiller AppSP ( Certkiller AppClass values) {...} private void DoWork(){ Certkiller AppClass myValues = new Certkiller AppClass(); Application.DoEvents(); Certkiller AppSP(myValues); Application.DoEvents(); }

    • D. 

      Private void Certkiller AppSP(object values) {...} private void DoWork(){ Certkiller AppClass myValues = new Certkiller AppClass(); Thread newThread = new Thread( new ParameterizedThreadStart( Certkiller AppSP)); newThread.Start(myValues); }

  • 35. 
    You create the following code segment: public delegate void FaxDocs(object sender, FaxArgs args); What should you do next to configure an event that will call FaxDocs? Choose the code segment which you should use.
    • A. 

      Public 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; } }}

  • 36. 
    You create a code segment that will call a function from the Win32 Application Programming Interface (API) via platform invoke. The precise code segment is: string personName = "N?el"; string msg = "Thank you " + personName + " for coming ''!"; bool rc = User32API.MessageBox(0, msg, personName, 0); You must specify the prototype method that will efficiently assemble the string data. Choose the code segment which will accomplish the task.
    • 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); }

  • 37. 
    You are creating a class library which must be able to access system environment variables. You must set a call method which will only force a runtime SecurityException if the callers which are higher in the call stack, fail to have the required permissions. Choose the call method which will do this.
    • A. 

      Use set.Demand();

    • B. 

      Use set.Assert();

    • C. 

      Use set.PermitOnly();

    • D. 

      Use set.Deny();

  • 38. 
    You are creating a new application named at Certkiller App11. Certkiller App11 will be used for a Certkiller .com business partner. The Certkiller business partner has offices in Hong Kong. You must write the code segment which will show all negative currency values by using a minus sign. Choose the code segment which you should use.
    • A. 

      NumberFormatInfo culture = new CultureInfo("zh-HK").NumberFormat; culture.NumberNegativePattern = 1; return numberToPrint.ToString("C", culture);

    • B. 

      NumberFormatInfo culture = new CultureInfo("zh-HK").NumberFormat; culture.CurrencyNegativePattern = 1; return numberToPrint.ToString("C", culture);

    • C. 

      CultureInfo culture = new CultureInfo("zh-HK"); return numberToPrint.ToString("-(0)", culture);

    • D. 

      CultureInfo culture = new CultureInfo("zh-HK"); return numberToPrint.ToString("()", culture);

  • 39. 
    You are developing a new application. You must define the code segment which will create a common language runtime (CLR) unit of isolation within the new application. Choose the code segment which you should use to accomplish this task.
    • A. 

      AppDomainSetup mySetup = AppDomain.CurrentDomain.SetupInformation; mySetup.ShadowCopyFiles = "true";

    • B. 

      System.Diagnostics.Process myProcess; myProcess = new System.Diagnostics.Process();

    • C. 

      AppDomain domain; domain = AppDomain.CreateDomain("CertkillerDomain");

    • D. 

      System.ComponentModel.Component myComponent; myComponent = new System.ComponentModel.Component();

  • 40. 
    You have to develop an application named Certkiller App21. When deployed, Certkiller App21 will be used by numerous users on the same computer. Certkiller App21 uses more than one assembly, and is configured to use isolated storage to store certain user information. You must create a new directory named UserInfo in the isolated storage area which is scoped to the current Microsoft Windows identity and assembly. Choose the code segment which will accomplish this task.
    • A. 

      IsolatedStorageFile store; store = IsolatedStorageFile.GetUserStoreForAssembly(); store.CreateDirectory("UserInfo");

    • B. 

      IsolatedStorageFile store; store = IsolatedStorageFile.GetMachineStoreForAssembly(); store.CreateDirectory("UserInfo");

    • C. 

      IsolatedStorageFile store; store = IsolatedStorageFile.GetUserStoreForDomain(); store.CreateDirectory("UserInfo");

    • D. 

      IsolatedStorageFile store; store = IsolatedStorageFile.GetMachineStoreForApplication(); store.CreateDirectory("UserInfo");