在中使用
WebClient类
System.Net:
var json = new WebClient().DownloadString("url");请记住
WebClient是
IDisposable,因此您可能会
using在生产代码中为此添加一条语句。看起来像:
using (WebClient wc = new WebClient()){ var json = wc.DownloadString("url");}
在中使用
WebClient类
System.Net:
var json = new WebClient().DownloadString("url");请记住
WebClient是
IDisposable,因此您可能会
using在生产代码中为此添加一条语句。看起来像:
using (WebClient wc = new WebClient()){ var json = wc.DownloadString("url");}