CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011
    Posts
    3

    4 days & no success with proxy login

    Hello, once again

    I have a very BIG problem. I made program that connect to proxy server and browse via proxy server. However, my company has a made private proxy server which I must authenticate through to get to the internet.

    I read hundreds pages of docs, but without success. My program code look like so:
    Code:
        module:
        Public Declare Sub UrlMkSetSessionOption Lib "urlmon.dll" _
        (ByVal dwOption As Long, ByRef pBuffer As Any, _
        ByVal dwBufferLength As Long, ByVal dwReserved As Long)
         
        Public Type INTERNET_PROXY_INFO
        dwAccessType As Long
        lpszProxy As String
        lpszProxyBypass As String
        End Type
        Public Const INTERNET_OPEN_TYPE_PROXY = 3
        Public Const INTERNET_OPTION_PROXY = 38
         
        Public Declare Function InternetSetOption Lib "wininet.dll" Alias "InternetSetOptionA" _
        (ByVal hInternet As Long, ByVal lOption As Long, ByRef sBuffer As Any, ByVal lBufferLength As Long) As Integer
        Public Declare Function InternetSetOptionStr Lib "wininet.dll" Alias "InternetSetOptionA" _
        (ByVal hInternet As Long, ByVal lOption As Long, ByVal sBuffer As String, ByVal lBufferLength As Long) As Integer
         
         
        form:
        Private Sub Command6_Click()
        Dim ipi As INTERNET_PROXY_INFO
        dim username as string 
        dim password as string 
    
        ipi.dwAccessType = INTERNET_OPEN_TYPE_PROXY
        ipi.lpszProxy = "46.37.165.113:17890"
        ipi.lpszProxyBypass = ""
         
        username = "america01" 'proxy server ID and PASS real and WORKING
        password = "YpEEJy8u"  'proxy server ID and PASS real and WORKING
         
        call UrlMkSetSessionOption(INTERNET_OPTION_PROXY_USERNAME, username, sizeof(username), 0);
        call UrlMkSetSessionOption(INTERNET_OPTION_PROXY_PASSWORD, password, sizeof(password), 0);
        call UrlMkSetSessionOption(INTERNET_OPTION_PROXY, ipi, Len(ipi), 0) 
        Form1.WebBrowser1.Navigate "http://whatismyipaddress.com/"
    What wrong I`m doing ?

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: 4 days & no success with proxy login

    Ask your ADMIN. We can't help with that particular situation. Read the AUP at the bottom of every page
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2010
    Posts
    14

    Re: 4 days & no success with proxy login

    When you open a web page with your browser are you prompted for login info at that time? This is when you're just using your standard browser.

    Do you have proxy info entered into the browser? Looks like your sing a browser activeX. If so, the proxy info must still be in the browser config.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured