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);
// ...