Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }