Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Go Back  Xtreme Visual Basic Talk > > > Webbrowser and INET proxy interoperability


Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2009, 07:52 PM
puggles puggles is offline
Newcomer
 
Join Date: May 2009
Posts: 1
Default Webbrowser and INET proxy interoperability


I'm in desperate need of some guidance, so any help would be greatly appreciated :duck:.

So I've been developing an application for a client for the past few weeks which does a lot of web interaction. I chose to write this in VB as it provided a good degree of simplicity from a development standpoint. Currently, all web interaction is performed using webbrowser controls, and the rest of the application is entirely dependant on these controls.

However, I was asked to implement HTTP, SOCKS 4, and SOCKS 5, support into the application, and I am having great difficulty doing so. I was able to implement HTTP proxy support by adding some code which changes IE settings (I've provided it at the bottom of the thread), but I can't find any documentation about how to add SOCKS support.

I have been exploring using INET control to add a proxy by doing something like:
Code:
Inet1.Proxy = mehmeh.com:745
But if I use INET this will make the hundreds of hours that I've spend developing around webbrowser controls pointless, as I would have to completely recode the application using INET.

So my question is, is there an easy way to add SOCKs support to my application, such as using a modified version of the code below, or is there an easy way to have INET and webbrowser controls interact without having to significantly alter their data?

Code:
    ' The structure we use for the information
    ' to be interpreted correctly by API.
    ' Add RefreshIESettings("127.0.0.1:8080")
    Public Structure Struct_INTERNET_PROXY_INFO
        Public dwAccessType As Integer
        Public proxy As IntPtr
        Public proxyBypass As IntPtr
    End Structure

    ' The Windows API function that allows us to manipulate
    ' IE settings programmatically.
    Private Declare Auto Function InternetSetOption Lib "wininet.dll" _
    (ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, _
     ByVal lpdwBufferLength As Integer) As Boolean

    ' The function we will be using to set the proxy settings.
    Private Sub RefreshIESettings(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

        ' Filling in structure
        struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY
        struct_IPI.proxy = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(strProxy)
        struct_IPI.proxyBypass = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi("local")

        ' Allocating memory
        Dim intptrStruct As IntPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI))

        ' Converting structure to IntPtr
        System.Runtime.InteropServices.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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
 
Webbrowser and INET proxy interoperability
Webbrowser and INET proxy interoperability
 
-->