asp.net 中如何请求一个其它网站的页面

HttpWebRequest web = (HttpWebRequest)HttpWebRequest.Create(url);
            web.ServicePoint.Expect100Continue = false;
            web.AllowAutoRedirect = false;
            web.ContentType = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
            web.Accept = this.Request.AcceptTypes.ToString();
            web.Method = "GET";
            web.UserAgent = this.Request.UserAgent;

            HttpWebResponse res = (HttpWebResponse)web.GetResponse();
            string html = new StreamReader(res.GetResponseStream(), Encoding.UTF8).ReadToEnd();
            return html;

原文地址:https://www.cnblogs.com/zziss/p/1782363.html