Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing text from a webpage
Message
De
07/05/2007 11:47:29
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
07/05/2007 11:40:35
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
Divers
Thread ID:
01223022
Message ID:
01223070
Vues:
17
That is odd. Oh well, it's fixed. If I ponder about every error I get, I wouldn't get any work done. ;-)

Have a good day!

>Hi,
>
>Hmm. So was the error coming from the server because the UserAgent info was missing? If so I wonder why the code worked on my machine without it. Oh well...
>Viv
>
>>Hey Viv,
>>I already posted my solution. I didn't include the user agent header.
>>
>>>Hi,
>>>
>>>C# version works for me:
>>>
>>>System.Net.WebClient webClient = new System.Net.WebClient();
>>>string value  = new System.Text.UTF8Encoding().GetString(webClient.DownloadData("http://whatismyip.org/"));
>>>
>>>What error were you getting?
>>>Best,
>>>Viv
>>>
>>>
>>>>I think I am trying too hard, but I just can't figure this out and am hoping somebody can point me in the right direction.
>>>>
>>>>I am trying to obtain the ip address displayed on http://whatismyip.org/ into my application. I found this snippet on the internet:
>>>>
>>>>
>>>>Dim value As String
>>>>Dim webClient As New System.Net.WebClient
>>>>
>>>>value = New System.Text.UTF8Encoding().GetString(webClient.DownloadData("http://whatismyip.org/"))
>>>>
>>>>
>>>>but I am getting an error. Is there an easier way to do this? There is no HTML - the source is just the ip address.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform