networking - What is the code for vb Proxy authentication credentials(username and password)

08
2014-07
  • user2689288

    This code shows adding proxy in visual basic

    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))
    

    and I use this code

    UseProxy("172.20.124.202" & ":" & "8080")
    

    But what is the code to add credentials (username and password)?

    Is there something like UseProxy("172.20.124.202" & ":" & "8080", "username" & ":" & "password")

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    Why is Google Chrome not saving proxy username/password?
  • Kevin

    Is there a way to have Chrome save username/password for proxy servers, so I don't have to type them in every time I start it up?


  • Related Answers
  • Matthew Talbert

    Click the little gear icon in the upper right corner, select "Options". Go to the tab "Under the Hood", and click "Change Proxy Settings". Make sure "Manual Proxy configuration" is selected and fill in your proxy. Click the "Details" button to enter your user and password.

  • Amós Batista

    To save login and password, go to the Options, and Personal Stuff. Select the option Offer to save passwords.

    After, close the browser, open again, and put your user and password. To verify if it works, close and re-open one more time. If Google Chrome loads the proxy login screen, with user and passwords already loaded, this workaround worked well.

  • Shaun

    For me Chrome knew which proxy server to connect to using the automatic settings it would just never prompt me to save the password.

    I found that after ensuring that the password wasn't saved incorrectly (using the manage saved passwords feature) that Chrome would only prompt me to save if I navigated to a domain which chrome had not recently resolved. I'm not sure if it somehow caches that it shouldn't prompt you for recent domains but this got Chrome to offer to remember to save the password, after that you only need to hit enter when it prompts you.