mirror of
https://github.com/wangqifan/ProxyPool.git
synced 2026-10-16 20:50:32 +08:00
1
This commit is contained in:
@@ -11,13 +11,14 @@ namespace ProxyPool
|
||||
{
|
||||
public class HttpHelper
|
||||
{
|
||||
public static string DownloadHtml(string url)
|
||||
public static string DownloadHtml(string url,WebProxy proxy)
|
||||
{
|
||||
string source = string.Empty;
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0";
|
||||
request.Proxy = proxy;
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||
{
|
||||
using (Stream dataStream = response.GetResponseStream())
|
||||
|
||||
Reference in New Issue
Block a user