exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 26 discussion

Actual exam question from Microsoft's 70-483
Question #: 26
Topic #: 1
[All 70-483 Questions]

DRAG DROP -
You are developing an application that will include a method named GetData. The GetData() method will retrieve several lines of data from a web service by object.
You have the following requirements:
✑ The GetData() method must return a string value that contains the first line of the response from the web service.
✑ The application must remain responsive while the GetData() method runs.
You need to implement the GetData() method.
How should you complete the relevant code? (To answer, drag the appropriate objects to the correct locations in the answer area. Each object 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.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Oziriz
Highly Voted 5 years, 11 months ago
In the question it says: The GetData() method must return a string value that contains the first line of the response from the web service. But the method is void?
upvoted 11 times
...
Mitsoshima
Highly Voted 5 years, 5 months ago
The result is stored in urlText.Text, so there is no need to return a value. I think this is just a wording mistake...
upvoted 10 times
...
SamarHussain
Most Recent 4 years, 2 months ago
No need to use readLineAnync() when you've already put await before the statement you can use readLine()
upvoted 2 times
hseagraves
3 years, 11 months ago
When I write this out and user ReadLine(), I get the error "'string' does not contain a definition for 'GetAwaiter'..."
upvoted 1 times
...
...
Waseemakramquresi
4 years, 3 months ago
https://docs.microsoft.com/en-us/dotnet/api/system.io.streamreader.readlineasync?view=netcore-3.1
upvoted 1 times
...
gerardo64823
4 years, 4 months ago
Don't use async void please! async Task should be used for this example
upvoted 5 times
...
alreadygone
4 years, 9 months ago
I think we should use ReadToEndAsync instead of ReadLineAsync. Right?
upvoted 1 times
tanujgyan
4 years, 8 months ago
The req says "The GetData() method must return a string value that contains the first line of the response from the web service.". You need first line only hence ReadLineAsync is used
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago