This repository has been archived by the owner on Apr 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ipman_98
committed
Oct 15, 2016
1 parent
2140906
commit 9c5c6df
Showing
8 changed files
with
96 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
' | ||
' Created by SharpDevelop. | ||
' User: IP-Man | ||
' Date: 10/15/2016 | ||
' Time: 8:07 AM | ||
' | ||
Imports System.Runtime.InteropServices | ||
|
||
Public Class Use_Proxy | ||
<Runtime.InteropServices.DllImport("wininet.dll", SetLastError:=True)> _ | ||
Private Shared Function InternetSetOption(ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean | ||
End Function | ||
|
||
Public Structure Struct_INTERNET_PROXY_INFO | ||
Public dwAccessType As Integer | ||
Public proxy As IntPtr | ||
Public proxyBypass As IntPtr | ||
End Structure | ||
|
||
Public Sub UseProxy(ByVal strProxy As String) | ||
Const INTERNET_OPTION_PROXY As Integer = 38 | ||
Const INTERNET_OPEN_TYPE_PROXY As Integer = 3 | ||
|
||
Dim struct_IPI As Struct_INTERNET_PROXY_INFO | ||
|
||
struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY | ||
struct_IPI.proxy = Marshal.StringToHGlobalAnsi(strProxy) | ||
struct_IPI.proxyBypass = Marshal.StringToHGlobalAnsi("local") | ||
|
||
Dim intptrStruct As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(struct_IPI)) | ||
|
||
Marshal.StructureToPtr(struct_IPI, intptrStruct, True) | ||
|
||
Dim iReturn As Boolean = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI)) | ||
End Sub | ||
End Class |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.