2 Replies - 294 Views - Last Post: 06 September 2019 - 08:42 PM Rate Topic: -----

#1 transavia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-September 19

How to change Socks 4/5 using vb.net

Posted 06 September 2019 - 08:25 PM

Posted Image
hi
how to use Socks 5 proxies in Internet Explorer. I have code for http proxies but that code is not working for Socks proxies.

Anyone has such code? Please provide some pointers.

I'm basically doing IE automation in VB.NET, and I need code to use socks proxies using IE.

the code am used that change only HTTP PROXY :
_ Private 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
Private Sub ButtonX4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX4.Click UseProxy(textBox4.text) WebBrowser2.Navigate(textBox1.text)

End Sub



Is This A Good Question/Topic? 0
  • +

Replies To: How to change Socks 4/5 using vb.net

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15260
  • View blog
  • Posts: 61,140
  • Joined: 12-June 08

Re: How to change Socks 4/5 using vb.net

Posted 06 September 2019 - 08:31 PM

What have you tried, looked into, or considered?
Was This Post Helpful? 0
  • +
  • -

#3 transavia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-September 19

Re: How to change Socks 4/5 using vb.net

Posted 06 September 2019 - 08:42 PM

View Postmodi123_1, on 06 September 2019 - 08:31 PM, said:

What have you tried, looked into, or considered?


i want to add a new socks5/4 but the code that i have it add only the http proxy

Posted Image
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1