Autor Beitrag
Metrik
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 80

Win XP, Win Vista
C# (VS 2003, #Develop)
BeitragVerfasst: So 26.02.06 14:06 
Hallo

Ich habe eine bestehende textdatei, die will ich nun mit c# öffnen und etwas ganzen unten hinzuschreiben! Der rest muss bestehen bleiben.

Wenn möglich Codebeispiele!!!
Danke im Voraus

MEtrik


Moderiert von user profile iconraziel: Topic aus C# - Die Sprache verschoben am So 26.02.2006 um 13:11
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 26.02.06 14:17 
Geht so:
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
            StreamWriter sw = new StreamWriter("c:\\bar.txt"true);
            try
            {
                sw.Write("foo");
            }
            finally
            {
                sw.Close();
            }


Der markierte Teil ist der append-Parameter des Konstruktors, welcher besagt, dass angehangen werden soll.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".