StreamWriter

string _FileText = "some text"; using (System.IO.StreamWriter _StreamWriter = new System.IO.StreamWriter("PathFile")) { _StreamWriter.Write(_FileText); _StreamWriter.Flush(); } using (System.IO.StreamWriter _StreamWriter = new System.IO.StreamWriter("PathFile")) { foreach (System.IO.DirectoryInfo _DirectoryInfo in new DirectoryInfo(@"c:\").GetDirectories()) { _StreamWriter.WriteLine(_DirectoryInfo.Name); } } MSDN Artikel

Von |2015-06-14T13:44:13+00:00Juni 14th, 2015|Kommentare deaktiviert für StreamWriter