public static string GetStringByMWebClient(string url, bool proxyEnable = false, IWebProxy wProxy = null, bool allowRedirect = true) { MWebClient mWebClient = new MWebClient { Headers = { ["User-Agent"] = "AuroraDNSC/0.1" } }; mWebClient.AllowAutoRedirect = allowRedirect; mWebClient.Proxy = proxyEnable ? wProxy : new WebProxy(); return(mWebClient.DownloadString(url)); }
public static string GetStringByMWebClient(string url, bool proxyEnable = false, IWebProxy wProxy = null) { MWebClient mWebClient = new MWebClient { Headers = { ["User-Agent"] = "AuroraDNSC/0.1" } }; //if (bool) webClient.AllowAutoRedirect = false; if (proxyEnable) { mWebClient.Proxy = wProxy; } return(mWebClient.DownloadString(url)); }