标题:请教高手,如何为WEBBROWER设置HTTPS代理
只看楼主
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1214
专家分:1366
注 册:2005-3-14
结帖率:100%
已结贴  问题点数:20 回复次数:4 
请教高手,如何为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

谢谢!
搜索更多相关主题的帖子: 代理 WEBBROWER HTTPS 
2009-11-25 15:44
三断笛
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:31
帖 子:1621
专家分:1617
注 册:2007-5-24
得分:5 
HTTPS代理?直接修改注册表不就可以吗?不是跟设置HTTP代理一样?你在IE属性中把代理设置成HTTPS的代理服务器试试。
2009-11-29 20:35
zhuyunshen
Rank: 6Rank: 6
等 级:侠之大者
威 望:2
帖 子:212
专家分:455
注 册:2009-11-22
得分:0 
HTTP
2009-11-29 20:36
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1214
专家分:1366
注 册:2005-3-14
得分:0 
回复 2楼 三断笛
不是修改系统中IE属性中的代理,而是只对当前应用程序设置代理,

如自已写一个浏览器,可以设置自已的代理.

http://toorup.3v.do
loading...
2009-11-29 23:38
三断笛
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:31
帖 子:1621
专家分:1617
注 册:2007-5-24
得分:15 
在网上看到过wininet使用HTTPS代理的,昨晚还搜索到源码来着,CSDN上的,你再搜搜看
2009-11-30 13:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-293351-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.509545 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved