标签:rac space pac OLE dem add string tostring time
static void FileStreamWriterReadDemo() { string textFile = "fs.txt"; using (FileStream fs = new FileStream(textFile, FileMode.Create)) { using (StreamWriter sw = new StreamWriter(fs)) { for (int i = 0; i < 100; i++) { string msg = $"Time:{DateTime.Now.ToString("yyyyMMddHHmmssffff")},Guid:{Guid.NewGuid()}"; sw.WriteLine(msg); Thread.Sleep(1); } } } using (StreamReader reader = new StreamReader(textFile)) { string result; while (!string.IsNullOrWhiteSpace(result = reader.ReadLine())) { Console.WriteLine(result); } } }
The key located at.
string result; while (!string.IsNullOrWhiteSpace(result = reader.ReadLine())) { Console.WriteLine(result); }
Resolve StreamReader ReadLine left the first character
标签:rac space pac OLE dem add string tostring time
原文地址:https://www.cnblogs.com/Fred1987/p/13042679.html