READ Free Dumps For Microsoft- 70-483
Question ID 17068 | You are implementing a method named ProcessFile that retrieves data files from web
servers and FTP servers. The ProcessFile () method has the following method signature:
Public void ProcessFile(Guid dataFileld, string dataFileUri)
Each time the ProcessFile() method is called, it must retrieve a unique data file and then
save the data file to disk.
You need to complete the implementation of the ProcessFile() method. Which code
segment should you use?
|
Option A | Option A
|
Option B | Option B
|
Option C | Option C
|
Option D | Option D
|
Correct Answer | D |
Explanation Explanation: * WebRequest.Create Method (Uri) Initializes a new WebRequest instance for the specified URI scheme. * Example: 1. To request data from a host server Create a WebRequest instance by calling Create with the URI of the resource. C# WebRequest request = WebRequest.Create("http://www.contoso.com/"); 2. Set any property values that you need in the WebRequest. For example, to enable authentication, set the Credentials property to an instance of the NetworkCredential class. C# request.Credentials = CredentialCache.DefaultCredentials; 3. To send the request to the server, call GetResponse. The actual type of the returned WebResponse object is determined by the scheme of the requested URI. C# WebResponse response = request.GetResponse(); 4. To get the stream containing response data sent by the server, use the GetResponseStream method of the WebResponse. C# Stream dataStream = response.GetResponseStream ();
Question ID 17069 | You write the following method (line numbers are included for reference only):
You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www\.)?([^\.]+)\.com;
Which code should you insert at line 07?
|
Option A | Option A
|
Option B | Option B
|
Option C | Option C
|
Option D | Option D
|
Correct Answer | D |
Explanation Explanation: * MatchCollection Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string. The collection is immutable (read-only) and has no public constructor. The Regex.Matches method returns a MatchCollection object. * List
.Add Method Adds an object to the end of the List. Incorrect: Not A: ICollection.SyncRoot Property For collections whose underlying store is not publicly available, the expected implementation is to return the current instance. Note that the pointer to the current instance might not be sufficient for collections that wrap other collections; those should return the underlying collection's SyncRoot property.