Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Web content thru basic authentication
Message
De
05/01/2005 02:36:21
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Librairie contrôle Web
Titre:
Accessing Web content thru basic authentication
Divers
Thread ID:
00974293
Message ID:
00974293
Vues:
67
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform