How should you complete the relevant code?

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 using a
System.IO.StreamReader object.
You have the following requirements:
The GetData() method must return a string value that contains the entire 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.)

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 using a
System.IO.StreamReader object.
You have the following requirements:
The GetData() method must return a string value that contains the entire 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.)

Answer:



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Mediterrano

Mediterrano

this is wrong
await await sr.ReadToEndAsync();

this is correct
await sr.ReadToEndAsync():

ReadToEndAsync returns a Task
await unpacks Taks to String and that´s it

Kim Tae Hong

Kim Tae Hong

I aggree

Jack

Jack

1. async
2. await
3. ReadToEndAsync();

Rao

Rao

Simil to the 28, but differ in > “The GetData() method must return a string value that contains the entire response from the web service.”

Google

Google

Always a major fan of linking to bloggers that I love but do not get a lot of link adore from.

Scott Allen

Scott Allen

come on guys, “await await” makes no sense here, you can’t await a string.. probably a broken question