0
var credentialStringValue = user + ":" + pass;
var credentialByteArray = ASCIIEncoding.ASCII.GetBytes(credentialStringValue);
var credentialBase64String = Convert.ToBase64String(credentialByteArray);
string authObject = string.Format("Proxy-Authorization: Basic {0}{1}", credentialBase64String, Environment.NewLine);
System.Windows.Forms.WebBrowser _WebBrowser = new System.Windows.Forms.WebBrowser();
_WebBrowser.Navigate("http://www.google.com", string.Empty, null, authObject);
上面的代碼用於將代理憑證傳遞給.NET WebBrowser控件。當轉到正常的HTTP URL時,它就像一個魅力,但當連接到SSL時失敗。這是什麼原因,SSL有什麼更好的選擇?代理授權:HTTPS的基本標頭失敗