
16.08.2008, 23:41
|
|
Участник форума
Регистрация: 30.03.2007
Сообщений: 131
Провел на форуме: 1449774
Репутация:
127
|
|
Пример на Basic (может поможет)
Код:
Private Type INTERNET_PROXY_INFO2
dwAccessType As Long
lpszProxy As String
lpszProxyBypass As String
End Type
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
Public Function ApplyProxy(Inject As Boolean) As Long
Dim strServers As String
Dim strBuffer As String
Dim ProxyInfo As INTERNET_PROXY_INFO2
strBuffer = "socks=127.0.0.1:44 https=127.0.0.1:44 http=127.0.0.1:44 " & _
"gopher=127.0.0.1:44 ftp=127.0.0.1:44"
strServers = RTrim$(strBuffer)
If Inject = True Then ProxyInfo.dwAccessType = 3 Else ProxyInfo.dwAccessType = 1
ProxyInfo.lpszProxy = strServers
ProxyInfo.lpszProxyBypass = ""
ApplyProxy = InternetSetOption(0&, 38, ProxyInfo, LenB(ProxyInfo))
End Function
|
|
|