日期:2014-05-17 浏览次数:21410 次
cookieHeader = response.Headers["Set-cookie"]; //get the cookie
webRequest.Headers.Add("Cookie", cookieHeader);
//////////////////////////////////////////////////////////////////////////
//photo page method 1-3 down load file
string file_name = "";
url = GetDownloadUrl(responseData);
url_reference = GetDownloadUrlRe(url,responseData);
file_name = GetFileNameViaURL(url);
//DownloadFile(url, "f:\\" + file_name, "a");
webRequest = WebRequest.Create(url) as HttpWebRequest;
webRequest.MediaType = "GET";
webRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20100101 Firefox/6.0.1";
webRequest.Host = "download.shutterstock.com";
webRequest.UseDefaultCredentials = true;
webRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
webRequest.KeepAlive = true;
webRequest.Headers.Add("Accept-Encoding", "gzip, deflate");
webRequest.Headers.Add("Accept-Language", "zh-cn,en-us;q=0.5");
webRequest.Headers.Add("Cookie", cookieHeader);//session in cookie