Supplying Basic Authentication during HTTP request in VB6

Posted on 2008-11-17
Last Modified: 2013-11-25
I'm trying to use VB6 to set and unset a privacy mode on a Panasonic BL-C111 IP Camera. This cgi function requires administrator credentials to be supplied. You cannot do this in IE, but in firefox you can use http://user:password@ to supply the credentials in line, any ideas how I can perform this within VB?
Question by:AshridgeTechServices
    1 Comment
    LVL 38

    Accepted Solution

    You can use components provided by Microsoft for HTTP use in script and VB

    Add a reference to Microsoft WinHTTP services:

    Option Explicit
    Private Sub Command1_Click()
        Dim http As WinHttpRequest
        Dim strResponse As String
        Set http = New WinHttpRequest
        http.Open "GET", "", False
        http.SetCredentials "admin", "admin", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
        strResponse = http.ResponseText
        Text1.Text = strResponse
    End Sub

    Open in new window


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now