奇怪的问题
我想从一个文件count.txt(路径:path)读出内容,然后删除,如何实现? 我的代码总是在删除是报错.
StreamReader sr=File.OpenText(path);
Application.Lock();
Application["count"]=sr.ReadLine();
Application["count"]=Convert.ToInt32(Application["count"])+1;
Application.UnLock();
sr.Close();
if (File.Exists(path))
{
File.Delete(path);
}