Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing Web content thru basic authentication
Message
From
05/01/2005 02:36:21
 
 
To
All
General information
Forum:
ASP.NET
Category:
Web control library
Title:
Accessing Web content thru basic authentication
Miscellaneous
Thread ID:
00974293
Message ID:
00974293
Views:
68
I have this function which works great to access the Web content of a specific HTML page:
    ' Get the HTML response from a server
    Public Shared Function GetUrl2(ByVal tcUrl As String, Optional ByVal tnTimeout As Integer = 5000) As String
        Dim lcHTML As String
        Dim lcUrl As New System.Uri(tcUrl)
        Dim loHTTP As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(lcUrl)
        loHTTP.Timeout = tnTimeout
        Try
            Dim loWebResponse As System.Net.WebResponse = loHTTP.GetResponse()
            Dim loStream As System.IO.Stream = loWebResponse.GetResponseStream()
            Dim loString As New System.IO.StreamReader(loStream)
            lcHTML = loString.ReadToEnd()
        Catch loError As Exception
            lcHTML = loError.Message
        End Try
        Return lcHTML
    End Function
But, I can't find the proper way to modify it so it will accept the username and password in order to authenticate against a page which requires a basic authentication.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform