Autor Beitrag
qwertzqwertyqwertzqwerty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
C# VS 2008
BeitragVerfasst: So 04.05.08 21:37 
Kann mir vielleicht jemand helfen. Ich wollte mit StreamReader eine Datei aus dem Internet lesen. Sah so aus:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
private void button1_Click(object sender, EventArgs e)
   {
        string textfile = "";
        try
        {
            StreamReader sr = newStreamReader("http://www.dieinternetseite.com/files/dastextdokument.txt");
            textfile = sr.ReadToEnd();
        }
        catch
        {
        }
    }


Das Dumme ist nur, dass er mir immer eine Exception auswirft: Uri-Formate werden nicht unterstützt.


Moderiert von user profile iconChristian S.: Topic aus C# - Die Sprache verschoben am So 04.05.2008 um 21:58
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 04.05.08 21:59 
Hallo!

Ich denke, wenn Du Dir in der Doku mal die HttpWebRequest-Klasse ansiehst, wirst Du glücklicher :-)

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
qwertzqwertyqwertzqwerty Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
C# VS 2008
BeitragVerfasst: Mo 05.05.08 14:26 
Danke,

ich bin tatsächlich glücklicher geworden :wink: