Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Commit

Permalink
coded to use proxy with IE
Browse files Browse the repository at this point in the history
  • Loading branch information
ipman_98 committed Oct 15, 2016
1 parent 2140906 commit 9c5c6df
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 53 deletions.
1 change: 1 addition & 0 deletions Fake Hits Generator.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<Compile Include="MainForm.vb" />
<Compile Include="Program.vb" />
<Compile Include="Properties\AssemblyInfo.vb" />
<Compile Include="Use_Proxy.vb" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\Settings.settings">
Expand Down
109 changes: 56 additions & 53 deletions MainForm.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="hit_timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
36 changes: 36 additions & 0 deletions Use_Proxy.vb
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 modified bin/Debug/Fake Hits Generator.exe
Binary file not shown.
Binary file modified bin/Debug/Fake Hits Generator.pdb
Binary file not shown.
Binary file modified obj/Debug/Fake Hits Generator.exe
Binary file not shown.
Binary file modified obj/Debug/Fake Hits Generator.pdb
Binary file not shown.

0 comments on commit 9c5c6df

Please sign in to comment.