PC Review


Reply
Thread Tools Rate Thread

Daten aus einer Website einlesen

 
 
Maximilian Hofer
Guest
Posts: n/a
 
      15th Mar 2005
Hallo NG,

zum erstellen einer Anfrag an eine Website benutze ich folgenden Code:


Dim encoding = New System.Text.UTF8Encoding

'Daten zum Posten zusammenbauen

Dim postData As String

postData = "username=" + TextBox1.Text

postData += ("&password=" + TextBox2.Text)

'in ein Byte-Array umwandeln

Dim data() As Byte

data = encoding.GetBytes(postData)

Dim myWebRequest As Net.HttpWebRequest

Dim myWebResponse As Net.HttpWebResponse

'Website zu der die Anfrage gestelt werden soll

myWebRequest =
myWebRequest.Create("https://secure.ycn.com/quickaccess/ycnadsl/phptool.php")

'POST

myWebRequest.Method = "POST"

myWebRequest.ContentType = "application/x-www-form-urlencoded"

myWebRequest.ContentLength = data.Length

Dim NewStream As System.IO.Stream

NewStream = myWebRequest.GetRequestStream()

NewStream.Write(data, 0, data.Length)

NewStream.Close()

'Abschicken...

myWebResponse = myWebRequest.GetResponse()

NewStream = myWebResponse.GetResponseStream()





Das scheint auch zu funktionieren, doch wie kann ich die Daten die mir die
Website zurückliefert z.B. in ein String einlesen?





mfg



MAx


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q3JvdWNoaWUxOTk4?=
Guest
Posts: n/a
 
      15th Mar 2005
What are your questions in ENGLISH or are you just promoting something?

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      15th Mar 2005
Maximilian,

Can you show us how and where you use this code and than with in English
please.

Although a major part of the messages (questions and answers) in this
newsgroup is done by non native English speaking people, is the used
language English, will you be so kind to do that as well.

For questions asked in the German Language there are active newsgroups
microsoft.public.de.german.entwickler.dotnet.vb
and when it is entwickler ASP
microsoft.public.de.german.entwickler.dotnet.asp

I hope this helps?

Cor



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Mar 2005
Hallo Maximilian!

"Maximilian Hofer" <(E-Mail Removed)> schrieb:
> zum erstellen einer Anfrag an eine Website benutze ich folgenden Code:
>[...]
>doch wie kann ich die Daten die mir die Website zurückliefert z.B. in ein
>String einlesen?


Beachte, dass dies eine englischsprachige Gruppe ist!

<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
 
=?Utf-8?B?Q3JvdWNoaWUxOTk4?=
Guest
Posts: n/a
 
      15th Mar 2005
Are you able to translate the original question for us non German speaking
people please Herfried?

Now, if it was in Polish I wouldn't have a problem
 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Mar 2005
Crouchie,

"Crouchie1998" <(E-Mail Removed)> schrieb:
> Are you able to translate the original question for us non German speaking
> people please Herfried?


The OP wants to download a file from the web and assign the file's content
to a string.

> Now, if it was in Polish I wouldn't have a problem


:-)

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      15th Mar 2005
Crouchie,

bez problem

zum erstellen einer Anfrag an eine Website benutze ich folgenden Code:
To fulfil a request from a website do I need the next code

'Website zu der die Anfrage gestelt werden soll
Website where the request will be done

Das scheint auch zu funktionieren, doch wie kann ich die Daten die mir die
Website zurückliefert z.B. in ein String einlesen?

Thas seems as welll to funcion, however how can I get the data that the
Website returns read into a String.


Cor


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      15th Mar 2005
Herfried,

You make me curious where did you assume that download, it has something to
do with to get a request using post.

However I see code I don't understand. When I had written this by instance
(with what it was) than I had directly gotten an question fom you from which
language it is. (It is not used in the code by the way)

Dim encoding = New System.Text.UTF8Encoding


Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Mar 2005
"Cor Ligthert" <(E-Mail Removed)> schrieb:
> You make me curious where did you assume that download, it has something
> to do with to get a request using post.


Well yes, I meant getting the data returned by the request...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Daten synchronisieren Peter Microsoft Windows 2000 1 19th Aug 2006 01:14 PM
Daten synchronisieren Peter Microsoft Windows 2000 Setup 1 18th Aug 2006 02:07 PM
CSV-Datei einlesen Matthias von Deetzen Microsoft VB .NET 3 30th Mar 2005 01:01 PM
.resx-Datein einlesen/wegschreiben Nadja Schmitt Microsoft C# .NET 1 7th Dec 2004 09:52 AM
Textfile beim Einlesen Zerstückeln? Michael Schindler Microsoft C# .NET 1 20th Nov 2003 08:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:51 AM.