Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[Source] Proxy Changer [Source]

We'll I've created a 'proxy changer' that enables and disables the proxy in your settings, this saves time as you don't have to navigate through 10 windows to get to it.

Now the code is below but there is one KEY problem. For the proxy change to take effect you still have to navigate to it.

Please help!

Code
Imports Microsoft.Win32

Public Class Form1
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim proxy As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Internet Settings", True)
        proxy.SetValue("ProxyEnable", 0)
        'Created By Coyney!
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim proxy As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Internet Settings", True)
        proxy.SetValue("ProxyEnable", 1)
        'Created By Coyney!
    End Sub
Testing it as we speak, hope it works XD!
Here's a easy way:
Code
Imports System.Runtime.InteropServices
Public Class Form1
#Region "Using 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

    Private 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 Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  UseProxy("PROXY:PORT")
  WebBrowser1.Navigate("http://www.whatismyip.com/") ' Or other site you want to load.
    End Sub

End Class

Source: https://hackforums.net/forum/Thread-VB-N...ser-Source , which is from http://www.youtube.com/watch?v=Bi0NyqjRh0Y
I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
Thank you Eternal for linking this. 
Thanks so much Eternal for this source!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by NinjaJul 11, 2017 11:29 PM 14 2,444 Jul 11, 2017 11:29 PM
Last Post: hunters
[.NET] by Security AnalystFeb 19, 2015 03:13 PM 2 131 Feb 19, 2015 03:13 PM
Last Post: ScammerHD
[C#] by Narut0xSyn30Dec 26, 2013 02:55 PM 5 4,950 Dec 26, 2013 02:55 PM
Last Post: Ban