using (System.IO.StreamWriter sw = new StreamWriter("D:\\province.txt", false, System.Text.Encoding.GetEncoding("GB2312")))
{
sw.Write(path);
sw.Flush();
sw.Close();
}
参数为false的时候为覆盖源文件
不是append
即为覆盖
否则即为追加
using (System.IO.StreamWriter sw = new StreamWriter("D:\\province.txt", false, System.Text.Encoding.GetEncoding("GB2312")))
{
sw.Write(path);
sw.Flush();
sw.Close();
}
参数为false的时候为覆盖源文件
不是append
即为覆盖
否则即为追加