一.把字符串讀取到文本文件中
using (FileStream fs = new FileStream(Path, FileMode.OpenOrCreate))//把json讀到一個文本中
{
StreamWriter sw = new StreamWriter(fs);
sw.Write(str);
sw.Close();
}
二。把一個文本文件讀取到字符串中
string str= File.ReadAllText(path);
一.把字符串讀取到文本文件中
using (FileStream fs = new FileStream(Path, FileMode.OpenOrCreate))//把json讀到一個文本中
{
StreamWriter sw = new StreamWriter(fs);
sw.Write(str);
sw.Close();
}
二。把一個文本文件讀取到字符串中
string str= File.ReadAllText(path);
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。