请教:System.IO 文件“d:\test.ascx”正由另一进程使用,因此该进程无法访问该文件

请问:System.IO 文件“d:\test.ascx”正由另一进程使用,因此该进程无法访问该文件。stringstrPathd:\\test.

请问:System.IO 文件“d:\test.ascx”正由另一进程使用,因此该进程无法访问该文件。
string   strPath   =   "d:\\test.ascx ";
File.Create(strPath);
StreamWriter   sw   =   new   StreamWriter(strPath,   false);
string   sContent   =   hiContent.Value;
sw.Write(sContent);
sw.Close();

错误
文件“d:\test.ascx”正由另一进程使用,因此该进程无法访问该文件。

[解决办法]
string strPath = "d:\\test.ascx ";File.Create(strPath);==> 这两句不需要.
[解决办法]
// OR
string strPath = "d:\\test.ascx ";
FileStream stream = File.Create(strPath);
StreamWriter sw = new StreamWriter(stream);
// ...