最新的Microsoft Programming in C# - 070-483免費考試真題
You are developing an application in C#.
You need to write a custom event to the Windows application log.
You have the following code.


You need to write a custom event to the Windows application log.
You have the following code.


正確答案:

You are developing an application that will populate an extensive XML tree from a Microsoft SQL Server 2008 R2 database table named Contacts.
You are creating the XML tree. The solution must meet the following requirements:
* Minimize memory requirements.
* Maximize data processing speed.
You open the database connection. You need to create the XML tree.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

You are creating the XML tree. The solution must meet the following requirements:
* Minimize memory requirements.
* Maximize data processing speed.
You open the database connection. You need to create the XML tree.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

正確答案:

Explanation:
The second box should be XElement and not the XAttribute as contacts, as you cannot have XElement as a child of an XAttribute.
You are developing an application by using C#.
You have the following requirements:
* Support 32-bit and 64-bit system configurations.
* Include pre-processor directives that are specific to the system configuration.
* Deploy an application version that includes both system configurations to testers.
* Ensure that stack traces include accurate line numbers.
You need to configure the project to avoid changing individual configuration settings every time you deploy the application to testers.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
You have the following requirements:
* Support 32-bit and 64-bit system configurations.
* Include pre-processor directives that are specific to the system configuration.
* Deploy an application version that includes both system configurations to testers.
* Ensure that stack traces include accurate line numbers.
You need to configure the project to avoid changing individual configuration settings every time you deploy the application to testers.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
正確答案: B,C
說明:(僅 Fast2test 成員可見)
You are developing a class named ExtensionMethods.
You need to ensure that the ExtensionMethods class implements the IsEmail() method on string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

You need to ensure that the ExtensionMethods class implements the IsEmail() method on string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

正確答案:

Explanation:
Extensions must be in a static class as it kind of a shared source of extension methods. You do not instantiate the class.
The key word "this" is simply a syntax how you tell the compiler, that your method IsUrl is extension for the String object
You are developing an application by using C#. The application will write events to an event log. You plan to deploy the application to a server.
You create an event source named AppSource and a custom log named AppLog on the server.
You need to write events to the custom log.
Which code segment should you use?

You create an event source named AppSource and a custom log named AppLog on the server.
You need to write events to the custom log.
Which code segment should you use?

正確答案: D
說明:(僅 Fast2test 成員可見)
You have the following code:

You need to retrieve all of the numbers from the items variable that are greater than 80.
Which code should you use?


You need to retrieve all of the numbers from the items variable that are greater than 80.
Which code should you use?

正確答案: B
說明:(僅 Fast2test 成員可見)
You have an existing order processing system that accepts .xml files,
The following code shows an example of a properly formatted order in XML:

You create the following class that will be serialized:

For each of the following properties, select Yes if the property is serialized according to the defined schema. Otherwise, select No.

The following code shows an example of a properly formatted order in XML:

You create the following class that will be serialized:

For each of the following properties, select Yes if the property is serialized according to the defined schema. Otherwise, select No.

正確答案:

Explanation:
OrderId - NO (this will serialize as an element, not as aa attribute)
OrderDate - NO (doesn't have DataMember attribute, thus is completely ignored) CustomerName - YES (DataMember is set correctly)
You are writing the following method (line numbers are included for reference only):

You need to ensure that CreateObject compiles successfully.
What should you do?

You need to ensure that CreateObject compiles successfully.
What should you do?
正確答案: C
說明:(僅 Fast2test 成員可見)
You are developing an application that includes a Windows Communication Foundation (WCF) service. The service includes a custom TraceSource object named ts and a method named DoWork. The application must meet the following requirements:
* Collect trace information when the DoWork() method executes.
* Group all traces for a single execution of the DoWork() method as an activity that can be viewed in the WCF Service Trace Viewer Tool.
You need to ensure that the application meets the requirements.
How should you complete the relevant code? (To answer, select the correct code segment from each drop-down list in the answer area.)


* Collect trace information when the DoWork() method executes.
* Group all traces for a single execution of the DoWork() method as an activity that can be viewed in the WCF Service Trace Viewer Tool.
You need to ensure that the application meets the requirements.
How should you complete the relevant code? (To answer, select the correct code segment from each drop-down list in the answer area.)


正確答案:

Explanation:
Activities are logical unit of processing. You can create one activity for each major processing unit in which you want traces to be grouped together. For example, you can create one activity for each request to the service. To do so, perform the following steps.
Save the activity ID in scope.
Create a new activity ID.
Transfer from the activity in scope to the new one, set the new activity in scope and emit a start trace for that activity.
The following code demonstrates how to do this.
Guid oldID = Trace.CorrelationManager.ActivityId;
Guid traceID = Guid.NewGuid();
ts.TraceTransfer(0, "transfer", traceID);
Trace.CorrelationManager.ActivityId = traceID; // Trace is static
ts.TraceEvent(TraceEventType.Start, 0, "Add request");
Reference:
https://msdn.microsoft.com/en-us/library/aa738759(v=vs.110).aspx
You are implementing a method named GetValidPhoneNumbers. The GetValidPhoneNumbers() method processes a list of string values that represent phone numbers.
The GetValidPhoneNumbers() method must return only phone numbers that are in a valid format.
You need to implement the GetValidPhoneNumbers() method.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

The GetValidPhoneNumbers() method must return only phone numbers that are in a valid format.
You need to implement the GetValidPhoneNumbers() method.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

正確答案: B,D
說明:(僅 Fast2test 成員可見)