请教高手,如何为WEBBROWER设置HTTPS代理
用以下函数设置代理可以打开HTTP页面,但HTTPS打不开,如不能登录163邮箱,--------------------------------------------------
Option Explicit
Private Type INTERNET_PROXY_INFO
dwAccessType As Long
lpszProxy As String
lpszProxyBypass As String
End Type
Private Const INTERNET_OPTION_PROXY = 38
Private Const INTERNET_OPTION_SETTINGS_CHANGED = 39
Private Const INTERNET_OPEN_TYPE_DIRECT = 1
Private Const INTERNET_OPEN_TYPE_PROXY = 3
Private Declare Function InternetSetOption Lib "wininet.dll" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal dwOption As Long, ByRef lpBuffer As Any, ByVal dwBufferLength As Long) As Long
--------------------------------------------------
Private Sub SetProxy(aStrIP As String, aStrPort As String, aBolUseProxy As Boolean)
Dim strProxy As String
Dim inf As INTERNET_PROXY_INFO
aStrIP = Trim(aStrIP)
aStrPort = Trim(aStrPort)
If (aStrIP + aStrPort = "") Or Not aBolUseProxy Then
strProxy = ""
Else
strProxy = "http=" + aStrIP + ":" + aStrPort
End If
If Trim(strProxy) <> "" Then
inf.dwAccessType = INTERNET_OPEN_TYPE_PROXY
inf.lpszProxy = strProxy
inf.lpszProxyBypass = ""
Call InternetSetOption(0, INTERNET_OPTION_PROXY, inf, Len(inf))
Call InternetSetOption(0, INTERNET_OPTION_SETTINGS_CHANGED, "", 0)
Else
inf.dwAccessType = INTERNET_OPEN_TYPE_DIRECT
inf.lpszProxy = ""
inf.lpszProxyBypass = ""
Call InternetSetOption(0, INTERNET_OPTION_PROXY, inf, Len(inf))
Call InternetSetOption(0, INTERNET_OPTION_SETTINGS_CHANGED, "", 0)
End If
End Sub
---------------------------------------------------
SetProxy txtip.Text, txtport.Text, True
WebBrowser1.Navigate stURL
谢谢!