13
Mevcut değilse ve yeni bir satır ekliyorsa bir .txt dosyası oluşturun
Bir .txt dosyası oluşturmak ve ona yazmak istiyorum ve dosya zaten varsa, sadece birkaç satır daha eklemek istiyorum: string path = @"E:\AppServ\Example.txt"; if (!File.Exists(path)) { File.Create(path); TextWriter tw = new StreamWriter(path); tw.WriteLine("The very first line!"); tw.Close(); } else if (File.Exists(path)) { TextWriter tw = new StreamWriter(path); tw.WriteLine("The next line!"); tw.Close(); …
161
c#
text-files