无法访问,它正在被另一个文件使用

无法访问,它正在被另一个文件使用

问题描述:

我正在asp.net c#Web应用程序中生成一个站点地图.
我正在使用临时文件,然后将所有数据提取到sml文件并将其邮寄到我的ID

但是当我尝试同时在2个差异浏览器中使用它时,一个浏览器向我显示了以上错误...

为我提供解决方案.

I am generating a sitemap in asp.net c# web app.
I am using temp file and then extract all the data to sml file and mail it to my id

but when i try to use it in 2 diff browsers at same time, one browser shows me the above error...

provide me solution.

您的问题是您的代码已损坏,并且您不太了解互联网的工作原理.您正在一个线程中为一个用户打开一个文件,然后在另一个线程尝试打开该文件时将其锁定.因此,请修复您的代码.我们无法告诉您如何操作,您没有发布它,但这涉及到关闭文件或每次需要时都创建唯一的临时文件.
Your problem is that your code is broken and you don''t really understand how the internet works. You are opening a file in one thread for one user, and then it''s locked when another thread tries to open it. So, fix your code. We can''t tell you how, you didn''t post it, but it involves closing the file, or creating unique temp files each time you need them.


如果您使用临时文件,您应该为此数据的每个请求生成一个唯一的(文件)名称,否则您将不断遇到问题.

干杯
If your using a temporary file, you should generate a unique (file)name for every request for this data, otherwise you will keep running into the problem.

Cheers