Resultados da pesquisa a pedido "c#-6.0"

9 a resposta

Aguardar no bloco catch

Eu tenho o seguinte código WebClient wc = new WebClient(); string result; try { result = await wc.DownloadStringTaskAsync( new Uri( "http://badurl" ) ); } catch { result = await wc.DownloadStringTaskAsync( new Uri( "http://fallbackurl" ) ); } ...