【发布时间】:2014-03-14 11:21:46
【问题描述】:
我想用这个方法来明文文件内容
private void writeTextFile(string filePath, string text)
{
if (!File.Exists(filePath))
{
File.Create(filePath).Close();
}
using (StreamWriter tw = new StreamWriter(filePath))
{
File.WriteAllText(filePath,"");
tw.WriteLine(text);
tw.Close();
}
}
但我得到了这个错误
The process cannot access the file because it is being used by another process.
但这不是在任何地方打开的,
请帮帮我 谢谢
【问题讨论】:
标签: c# streamwriter