private string getWebresourceFile1(string url)
{
WebClient myWebClient = new WebClient();
byte[] myDataBuffer = myWebClient.DownloadData(url);
string SourceCode = Encoding.Default.GetString(myDataBuffer);
saveSourceCode(SourceCode);
return SourceCode;
}
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.baidu.com/index.aspx");
myRequest.GetResponse();
WebClient _Client = new WebClient();
_Client.OpenRead("http://www.baidu.com/index.aspx”);
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)