Autor Beitrag
Stefanie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Do 29.06.06 11:33 
Hallo!

wie erstelle ich eine neue Datei mit dem Pfad: "C:\hallo.txt"?

habe in der Hilfe nichts gefunden, hoffe ihr könnt mir helfen!

Danke


Moderiert von user profile iconChristian S.: Topic aus C# - Die Sprache verschoben am Do 29.06.2006 um 11:44
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 29.06.06 11:49 
Hallo!

Schau Dir mal die StreamWriter-Klasse in Namespace System.IO an, die sollte Dir weiterhelfen.

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
mklaus
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Di 08.08.06 16:00 
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
using System.IO;
...
void CSharp_Datei_schreiben()
{
 StreamWriter myWriter = File.CreateText(@"c:\hallo.txt");
 myWriter.WriteLine("Zeile1");
 myWriter.WriteLine("Zeile2");
 myWriter.Close();
}
...

www.tsql.de/csharp/c..._datei_schreiben.htm