求教?那位大侠会往打开的notepad里显示文本流啊?
求教?那位大侠会往打开的notepad里显示文本流啊? 用什么方法?
//首先加入using string path=@"C:\随机写入文档.txt"; streamReader sr=new streamRead(path); while(!sr.Endofstream) { Console.WriteLine(sr.ReadLine); } sr.Flush(); sr.Close();
using System; using using System.Diagnostics; namespace Test { class Test { static void Main() { string data = string.Format("This is{0}some arbitrary{0}data...", Environment.NewLine); string filePath = Path.GetTempFileName(); File.WriteAllText(filePath, data); Process.Start("notepad", filePath); } } }