c# 生成txt文件,写入内容
string path = Application.StartupPath + "\\" + "timeLenth.txt"; FileStream fs1 = new FileStream(path, FileMode.Create, FileAccess.Write);//搜索创建写入文件 StreamWriter sw = new StreamWriter(fs1); sw.Write("Content no other line"); sw.Write(" "); sw.WriteLine("huanHang"); sw.Close(); fs1.Close(); System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(); info.FileName = path; System.Diagnostics.Process.Start(info);