c# - Convert Task<String> to String in Windows 8 apps -


i writing windows 8 app. have code :

public async task<string> readweb()     {         var uri = new uri(@"http://stackoverflow.com/");         var httpclient = new httpclient();         var data = await httpclient.getstringasync(uri);         string text = data;         return text;     }  

i want web-data string data = readweb(); error "cannot convert task string". me! thanks!

do this,

public async task<string> readweb()     {         var uri = new uri(@"http://stackoverflow.com/");         var httpclient = new httpclient();         var data = await httpclient.getstringasync(uri);         string text = data;         return text;     }   private async void something() {     var data = await readweb(); } 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -