郁闷,这样的代码为什么会报异常呢?
using System.IO;
.
.
String fileName = "abc.txt";
private void button2_Click(object sender, EventArgs e)
{
File.Create(fileName);
Stream stm = File.OpenWrite(fileName);
.
.
}
异常发生在第二行代码:
{"The process cannot access the file 'E:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2005\\Projects\\FileList\\FileList\\bin\\Debug\\abc.txt' because it is being used by another process."}
不是在同一个process里面的吗?