ADBaseLibrary.Proxy.CreateProxy C# (CSharp) Method

CreateProxy() public method

public CreateProxy ( ) : WebProxy
return System.Net.WebProxy
        public WebProxy CreateProxy()
        {
            NetworkCredential nt = null;
            if (!string.IsNullOrEmpty(ProxyUsername) || !string.IsNullOrEmpty(ProxyPassword))
                nt = new NetworkCredential(ProxyUsername, ProxyPassword);
            UriBuilder bld = new UriBuilder(ProxyAddress);
            bld.Port = ProxyPort;
            return new WebProxy(bld.Uri, false, null, nt);
        }