拆车坊瑞虎7拆解视频:谁能告诉我c#如何保存网站的附加码图片到本地硬盘中

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/02 12:16:51
原来我是用这个直接写屏:
public byte[] images(string url,string cookie,string refe)
{
WebClient myWebClient = new WebClient();
myWebClient.Headers.Add("Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*");
myWebClient.Headers.Add("Accept-Language: zh-cn");
myWebClient.Headers.Add("Accept-Encoding: gzip, deflate");
myWebClient.Headers.Add("User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)");
myWebClient.Headers.Add("Cookie: "+cookie);
myWebClient.Headers.Add("Referer:"+refe);
byte[] myDataBuffer = myWebClient.DownloadData(url);
myWebClient.Dispose();
return myDataBuffer;
}