c# 建立臨時文件 並寫入數據
阿新 • • 發佈:2018-02-11
files Coding system file hang move using rep ext
//建立臨時文件 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(); }
c# 建立臨時文件 並寫入數據