向高手求救:The process cannot access the file 'X:\X.XXX' because it is being used by another process

moonwrite moonwrite 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
页面外有个Generate按钮 点击了后 调用Generate()方法

但出现的问题是这样的
1.我登陆后 点击Generate按钮 过了6分钟后 被弹出了 要重新登陆 可是Session的时间还没有过 Session是保存在MSSQL中的
2.我再登陆后 点击Generate按钮 差不多有过了6分钟 提示:
The process cannot access the file "C:\\accounts\i-techcomau\products\Products.xml" because it is being used by another process.

几天了 一直重复的上面的问题

最后说一下 asp 和 aspx 所在的那个文件夹 里面有7万多过个文件了~~~

有什么方法可以解决这个问题啊~~~

using System;
using System.IO;
using System.Data;
using System.Text;
using MYSDatabase.DataSet;
using Microsoft.ApplicationBlocks.Data;

public class FileGenerator
{
// Fields
private int appID = -1;
private string rootFolder = null;
private string websiteName = null;


// Methods
public FileGenerator(int appID, string rootFolder)
{
this.appID = appID;
this.websiteName = new SystemAdmin().GetApplicationWebsite(appID);
this.rootFolder = rootFolder;
}

public string Generate()
{
StreamWriter writer = null;
StreamWriter writer1 = null;
StreamWriter writer2 = null;
StreamWriter writer3 = null;
StreamWriter writer4 = null;
StreamWriter writer5 = null;
StreamWriter writer6 = null;
StringBuilder builder = new StringBuilder();
if ((this.appID != -1) && (this.rootFolder != null))
{
File.Delete(row.RootFolder + @"\" + row.ProductFolder + @"\Products.xml");
删除的就是C:\\accounts\i-techcomau\products\Products.xml
writer = new StreamWriter(row.RootFolder + @"\" + row.ProductFolder + @"\Products.xml", false);
writer.WriteLine("<?xml version=\"1.0\" ?>");
writer.WriteLine("<products>");
在这里面开始使用writer~writer6根据数据库生成aspx和asp文件
}
return builder.ToString();
}
}
...全文

相关推荐

Windows 蓝屏代码详解

Windows在使用中会遇到蓝屏情况,蓝屏时提示的编码可以直接告诉我们产生蓝屏的原因所在;参考《windows蓝屏代码详解》让维护工作更加得心应手。

L-文禮

Fstream: Managing Flash Sreams in the File System PPT

Fstream: Managing Flash Sreams in the File System PPT

菜菜菜菜菜菜高

Direct Memory Access in Linux.doc

Direct Memory Access in Linux.

maimang09

Adapting AWStats for IBM WebSphere Portal 6.0.x and virtual portals

The functionality to track site usage is still provided as of IBM® WebSphere® Portal version 6.0.x, but the Tivoli® Web Site Analyzer that charts the resulting log files from version 5.1 was deprecated. As a result, the open-source solution AWStats has become increasingly popular with WebSphere Portal customers. The free software product creates extensive charts formatted for browser access with minimal effort; however, it cannot discern between virtual portals and does not display the human-readable part of the site URL string. This white paper explains how to extend AWStats to provide the missing functionality.

WKNJT

open file view

Description OpenedFilesView displays the list of all opened files on your system. For each opened file, additional information is displayed: handle value, read/write/delete access, file position, the process that opened the file, and more... Optionally, you can also close one or more opened files, or close the process that opened these files. This utility is especially useful if you try to delete/move/open a file and you get one of the following error messages: Cannot delete [filename]: There has been a sharing violation. The source or destination file may be in use. Cannot delete [filename]: It is being used by another person or program. Close any programs that might be using the file and try again. When you get one of these error messages, OpenedFilesView will show you which process lock your file. Closing the right process will solve this problem. optionally, you can also release the file by closing the handle from OpenedFilesView utility. However, be aware that after closing a file in this way, the program that opened the file may become unstable, and even crash. System Requirements This utility works properly on Windows 2000, Windows XP, Windows 2003/2008, Windows Vista, and Windows 7 (32-bit only !). Older versions of Windows (NT/9x/ME) are not supported. Also, you must have administrative privilege in order to run this utility.

thjgo
评论 16
收藏 已收藏
分享
返回顶部
moonwrite
.NET社区 62,272 成员 668,968 内容