//建立临时文件 string tempFile = Path.GetTempFileName(); string ls_fileNeme = System.IO.Path.ChangeExtension(ls_file, ".rep"); File.Move(ls_file, ls_fileNeme);//修改文件扩展名 using (FileStream fs = new FileStream(ls_fileNeme, FileMode.Open)) { StreamWriter sw = new StreamWriter(fs, Encoding.Unicode); sw.WriteLine("what are you doing"); sw.Flush(); sw.Close(); }
原文地址:https://www.cnblogs.com/cxyzhangjie/p/8440623.html
时间: 2024-11-04 11:52:01