Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the content of a URL
Message
De
01/10/2006 18:24:44
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Getting the content of a URL
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01158458
Message ID:
01158458
Vues:
58
I have this code to get the content of a URL:
        ' Get the HTML response from a server
        ' expC1 Url
        Public Function GetUrl(ByVal tcUrl As String) As String
            Dim lcHTML As String
            Dim loHTTP As System.Net.WebClient = New System.Net.WebClient
            Dim loEncoding As System.Text.Encoding = New System.Text.ASCIIEncoding
            Dim loRequestedHTML() As Byte
            Try
                loRequestedHTML = loHTTP.DownloadData(tcUrl)
                lcHTML = loEncoding.GetString(loRequestedHTML)
            Catch loError As Exception
                lcHTML = loError.Message
            End Try
            Return lcHTML
        End Function
I am wondering about the declaration of the loEncoding. I put ASCIIEncoding for now. But, when getting the content of a URL, is that the proper encoding to use?
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