Senparc.Weixin.HttpUtility.RequestUtility.SetHttpProxy C# (CSharp) Method

SetHttpProxy() public static method

设置Web代理
public static SetHttpProxy ( string host, string port, string username, string password ) : void
host string
port string
username string
password string
return void
        public static void SetHttpProxy(string host, string port, string username, string password)
        {
            ICredentials cred;
            cred = new NetworkCredential(username, password);
            if (!string.IsNullOrEmpty(host))
            {
                _webproxy = new WebProxy(host + ":" + port ?? "80", true, null, cred);
            }
        }