Drive(s)

System.IO.DriveInfo[] _allDrives = System.IO.DriveInfo.GetDrives(); foreach (System.IO.DriveInfo _Drive in _allDrives) { System.Windows.Forms.MessageBox.Show(_Drive.TotalSize.ToString()); System.Windows.Forms.MessageBox.Show(_Drive.TotalFreeSpace.ToString()); }

Von |2015-06-15T21:42:22+00:00Juni 15th, 2015|Kommentare deaktiviert für Drive(s)

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

StreamReader

string _FileText; using (System.IO.StreamReader _StreamReader = new System.IO.StreamReader("PathFile")) { _FileText = _StreamReader.ReadToEnd(); } string _TextLine; using (System.IO.StreamReader _StreamReader = new System.IO.StreamReader("PathFile")) { while ((_TextLine = _StreamReader.ReadLine()) != null) { Console.WriteLine(_TextLine); } } MSDN Artikel

Von |2015-06-14T13:35:51+00:00Juni 14th, 2015|Kommentare deaktiviert für StreamReader