该进程无法访问该文件,因为该文件正由另一个进程使用。 [英] The process cannot access the file because it is being used by another process.

查看:134
本文介绍了该进程无法访问该文件,因为该文件正由另一个进程使用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友......

我参与项目创建2个Windows服务

第一个服务从FTP文件夹获取.csv文件然后移动到进程/工作文件夹。这项服务工作正常。

Second Service从Process / Working Folder获取.csv文件并更改格式并将文件移动到Historian Folder。但是这个服务工作正常,同时使用断点调试Windows应用程序的服务代码。但没有断点,它开始抛出如下错误。



进程无法访问该文件,因为它正被另一个进程使用。



以下是我的第二个服务代码



  public   partial   class  Form1:Form 
{

public static string workingfolderpath = ;
public static string errorfolderpath = ;
public static string historianfolderpath = ;
public static string filepath = ;
public System.Timers.Timer ObjTimer;

public Form1()
{
InitializeComponent();

NameValueCollection settings = ConfigurationManager.GetSection( customAppSettingsGroup / customAppSettings)< span class =code-keyword> as System.Collections.Specialized.NameValueCollection;
workingfolderpath = settings [ process]。ToString();
errorfolderpath = settings [ error]。ToString();
historianfolderpath = settings [ hist]。ToString();
ObjTimer = new System.Timers.Timer();


// ObjTimer.Elapsed + = new ElapsedEventHandler(ObjTimer_Elapsed);
ObjTimer.Interval = 60000 ; // 这等于1分钟,即1分钟= 60000毫秒
ObjTimer.Enabled = true ;
ObjTimer.AutoReset = true ;

}


public static void ProceesFile( string _filename)
{
List< string> ObjListFile = new List< string>();
尝试
{
ObjListFile.Add(_filename);
string [] file = _filename.Split(' \\');
StreamReader ObjStreamReader = new StreamReader(File.OpenRead(_filename));
string [] line = ObjStreamReader.ReadLine()。Split(' ;');
string [] machinename = _filename.Split(' _ );
for int i = 2 ; i < line.Length; i ++)
{
line [i] = string .Concat(machinename [machinename.Length - 1 ]。删除(machinename [machinename.Length - 1 ] .IndexOf( .csv)), _,line [i] .Trim(' '));
}

列表< System.Collections.Generic.List< string>> ObjListColumns = new List< List< string>>();
// 这里
for int i = 1 ;我< line.Length; i ++)
{
ObjListColumns.Add( new List< string>());
}

string [] values = null ;
while (!ObjStreamReader.EndOfStream)
{
values = null ;
values = ObjStreamReader.ReadLine()。Split(' ;');
for int i = 0 ; i < ObjListColumns.Count; i ++)
{
ObjListColumns [i] .Add(values [i + 1 ]);
}
}
ObjStreamReader.Close();
ObjStreamReader.Dispose();
GC.Collect();

for int i = 0 ; i < ObjListColumns [ 0 ]。计数; i ++)
{
ObjListColumns [ 0 ] [i] = ObjListColumns [ 0 ] [i]。修剪(' ')。修剪(' \\')。修剪(' ');
}
for int i = 0 ; i < ObjListColumns.Count; i ++)
{
for int j = 0 ; j < ObjListColumns [i] .Count; j ++)
{
ObjListColumns [i] [j] = ObjListColumns [i] [j] .Trim(' ');
}
}
ObjListFile.Add(workingfolderpath + \\w + file [file.Length - 1 ]);
FileStream ObjFileStream = new FileStream(workingfolderpath + \\w + file [file.Length - 1 ],FileMode.OpenOrCreate);
StreamWriter ObjWriter = new StreamWriter(ObjFileStream);

string text = null ;
ObjWriter.WriteLine( [Data]);
ObjWriter.WriteLine( Tagname; TimeStamp; Value; DataQuality);
string [] datetime = null ;
for int i = 2 ; i < line.Length; i ++)
{
for int j = 0 ; j < ObjListColumns [i - 1 ]。计数; j ++)
{
text = null ;
// text = line [i] .ToString()+;+ ObjListColumns [0] [ j] .ToString()+;+ ObjListColumns [i - 1] [j] .ToString()+;+Good;
int sec = 1 + j;
datetime = ObjListColumns [ 0 ] [j] .ToString()。Split(' < span class =code-string>'
);
datetime [ 0 ] = DateTime.Now.AddDays(-1).ToShortDateString();
text = line [i] .ToString()+ ; + datetime [< span class =code-digit> 0
] + + datetime [< span class =code-digit> 1
] + ; + ObjListColumns [ i - 1 ] [j] .ToString()+ ; + ;
// text = line [i] .ToString()+; + DateTime.Now.AddMinutes(-sec).ToString(M / d / yyyy HH:mm:ss)+; + ObjListColumns [i - 1] [j] .ToString()+; +好;
ObjWriter.WriteLine(text);
}
}
ObjWriter.Flush();
ObjFileStream.Flush();
ObjWriter.Close();
ObjWriter.Dispose();
ObjFileStream.Close();
ObjFileStream.Dispose();
GC.Collect();
Microsoft.Office.Interop.Excel.Application ObjApplication = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook ObjWorkBook = ObjApplication.Workbooks.Open(workingfolderpath + \ \w + file [file.Length - 1 ], 0 false 5 false ,XlPlatform.xlWindows, ; true false 0 true false false );
Microsoft.Office.Interop.Excel.Worksheet ObjWorkSheet = ObjApplication.ActiveWorkbook.ActiveSheet;
ObjApplication.Columns [ A:A]。选择();
ObjApplication.Selection.TextToColumns(ObjApplication.Range [ A1],XlTextParsingType.xlDelimited ,XlTextQualifier.xlTextQualifierNone,Type.Missing,Type.Missing, true ,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type .Missing,Type.Missing,Type.Missing);
ObjWorkSheet.SaveAs(workingfolderpath + \\c + file [file。长度 - 1 ],Microsoft.Office.Interop.Excel.XlFileFormat.xlCSV);
// ObjWorkBook.Save();
// ObjWorkBook.Close();
// ObjApplication.SaveWorkspace();

GC.Collect();

处理[] proc = Process.GetProcessesByName( EXCEL);
proc [ 0 ]。Kill();
proc [ 0 ]。Dispose();
// 调用MoveToHistorian()
ObjListFile.Add(workingfolderpath + \\c + file [file.Length - 1 ]);
MoveToHistorian(workingfolderpath + \\c + file [file.Length - 1 ]);

}
catch (Exception Obj)
{
// 调用MoveToError()
string [] file = _filename。拆分(' \\');
MoveToError(workingfolderpath + \\c + file [file.Length - 1 ],Obj.Message);
}
最后
{
// < span class =code-comment>删除应用程序从工作文件夹创建的所有临时文件

foreach string filename ObjListFile)
{
if (File.Exists(filename))
{
File.Delete(filename);
}
}
}
}

public static Boolean IsFileLocked(FileInfo file)
{
FileStream stream = ;
try
{
stream = file.Open(FileMode.Open,FileAccess.Read,FileShare.None);
}
catch (IOException)
{
return true ;
}
最后
{
如果(流!= null
stream.Close();
}
返回 false ;
}

public static void FindFileInProcessFolder()
{
foreach string 文件 Directory.GetFiles(workingfolderpath))
{
if (file .EndsWith( 。csv))
{
FileInfo ObjFileInfo = < span class =code-keyword> new
FileInfo(file);
FileInfo ObjFileInUse = new FileInfo(workingfolderpath + \\ + ObjFileInfo.Name);
if (!IsFileLocked(ObjFileInUse))
{
ProceesFile(ObjFileInUse.FullName);
break ;
}
}
}
}

public static void MoveToHistorian( string _filename)
{
// 将文件移至Historian文件夹
string [] file = _filename.Split(' \\');
if (File.Exists(_filename))
{
Process [] proc = Process.GetProcessesByName( EXCEL);
if (proc.Length > 0
{
proc [ 0 ]。Kill();
proc [ 0 ]。Dispose();
}

File.Move(_filename,historianfolderpath + \\ + file [file.Length - 1 ]);
}
}

public static void MoveToError( string _filename, string _errormessage)
{
// 将文件移至错误文件夹
// 并使用消息,文件名和时间戳更新错误文件
string [] file = _filename.Split(' \\' );
if (File.Exists(_filename))
{
Process [] proc = Process.GetProcessesByName( EXCEL);
if (proc.Length > 0
{

proc [ 0 ]。Kill();
proc [ 0 ]。Dispose();
}
if (File.Exists(errorfolderpath + \\ + file [file.Length - 1 ]))
{
File .Delete(errorfolderpath + \\ + file [file.Length - 1 ]);
}
File.Move(_filename,errorfolderpath + \\ + file [file.Length - 1 ]);
}
FileStream ObjFileStream = new FileStream(errorfolderpath + \\ + error.txt, FileMode.Append,FileAccess.Write);
StreamWriter ObjWriter = new StreamWriter(ObjFileStream);
ObjWriter.WriteLine(errorfolderpath + \\ + file [file.Length - 1 ] + =: + DateTime.Now.ToString()+ + _errormessage);
ObjWriter.Close();
ObjFileStream.Close();

处理[] proc1 = Process.GetProcessesByName( EXCEL);
if (proc1.Length > 0
{
proc1 [ 0 ]。Kill();
proc1 [ 0 ]。Dispose();
}


}

private void button1_Click( object sender,EventArgs e)
{
Form1.FindFileInProcessFolder();
}

}





帮我看看为什么会发生在没有断点的情况下进行调试。

谢谢。

解决方案

错误是非常自我解释的,你试图对文件做些什么虽然它被其他一些进程使用(可能是试图移动或删除等)。



如果你不知道什么文件然后添加日志代码到你的代码将异常和相关信息写入您可以阅读的文本文件中,例如: log4net的迷你插件替换 [ ^ ]


我们在这里有很多问题,首先我想提倡分离问题。 />


所以你在wi中锚定应该显示的ndows表单,然后你提出了对文件夹的监视处理,这是另一个问题然后你似乎正在使用';'作为listseperator监视csv文件,当你找到这样的时候获取列,然后重新创建一个csv类型的文件然后将第一行[Data]写入工作文件夹。

最后,您继续创建一个新的Excel工作簿并将其粘贴到工作文件夹中。



除此之外,您正在对GC线程进行大量的明确处理,这真的不应该......就像以前一样。并尝试杀死excel作为一个过程和东西。也不应该是必要的。



因此我认为你应该通过彼此反映可识别的部分来实现。当您释放互操作COM对象时,请使用System.Runtime.InteropServices.Marshal.ReleaseComObject(ObjApplication);在调用之后.Quit()



我的第一个猜测是,在你尝试MoveToHistorian之前,你的工作簿处理之间没有及时发布。不要做任何GetProcessByName + Kill的东西,你已经有了一个COM句柄,所以请使用它,并且请将所有你的domaine名称细节改为使用语句,而是让我们所有人都睁大眼睛试图阅读这些行:D



无论如何,摆脱你的COM实例应该在你的ObjWorkSheet.SaveAs之后阅读...

 ObjApplication.Quit(); 
System.Runtime.InteropServices.Marshal.ReleaseComObject(ObjApplication);
// ObjWorkBook.Save();
// ObjWorkBook.Close();
// ObjApplication.SaveWorkspace();

// GC.Collect();

// 流程[ ] proc = Process.GetProcessesByName(EXCEL);
// proc [0] .Kill();
// proc [0] .Dispose();
// 调用MoveToHistorian()
ObjListFile.Add(workingfolderpath + \\c + file [file.Length - 1 ]);
MoveToHistorian(workingfolderpath + \\c + file [file.Length - 1 ]);





恕我直言:你应该考虑重构整个事情,例如你的目录监控可能是使用FileSystemWatcher < a href =https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx> https://msdn.microsoft.com/en-us /library/system.io.filesystemwatcher%28v=vs.110%29.aspx [ ^ ]



然后整个Excel处理和为了它自己的目的使用临时文件夹也应该放在它自己的单独的类中,最后你的ui可以加入通知并且可能拥有一个带有filesystemwatcher的(单独的?)类。

目前你有一个小的程序试图在同一时间做很多事情,这在概念上彼此无关,然后从明显的调试管道,如明确地解决垃圾收集器和进程l ifetime应该删除。



我很想提供重写,但我认为这些建议可能足以让你完成



干杯!


请看我过去的答案:如何压缩错误'它已经被vb.net中的另一个进程使用了​​ [ ^ ]。



-SA

Hello Friends...
I m involved in project creating 2 windows service
First service takes .csv file from FTP Folder then moves to Process/Working Folder. This service working fine.
Second Service takes .csv file from Process/Working Folder and change it format and move a file to Historian Folder. But this service working fine while debugging the service code with windows application using break point. But without break point it starts throwing an error as follows.

"The process cannot access the file because it is being used by another process."

Following is my second service code

public partial class Form1 : Form
   {

       public static string workingfolderpath = "";
       public static string errorfolderpath = "";
       public static string historianfolderpath = "";
       public static string filepath = "";
       public System.Timers.Timer ObjTimer;

       public Form1()
       {
           InitializeComponent();

           NameValueCollection settings = ConfigurationManager.GetSection("customAppSettingsGroup/customAppSettings") as System.Collections.Specialized.NameValueCollection;
           workingfolderpath = settings["process"].ToString();
           errorfolderpath = settings["error"].ToString();
           historianfolderpath = settings["hist"].ToString();
           ObjTimer = new System.Timers.Timer();


           //ObjTimer.Elapsed += new ElapsedEventHandler(ObjTimer_Elapsed);
           ObjTimer.Interval = 60000;    //this is equal to 1 minute   i.e 1 minute= 60000 miliseconds
           ObjTimer.Enabled = true;
           ObjTimer.AutoReset = true;

       }


       public static void ProceesFile(string _filename)
       {
           List<string> ObjListFile = new List<string>();
           try
           {
               ObjListFile.Add(_filename);
               string[] file = _filename.Split('\\');
               StreamReader ObjStreamReader = new StreamReader(File.OpenRead(_filename));
               string[] line = ObjStreamReader.ReadLine().Split(';');
               string[] machinename = _filename.Split('_');
               for (int i = 2; i < line.Length; i++)
               {
                   line[i] = string.Concat(machinename[machinename.Length - 1].Remove(machinename[machinename.Length - 1].IndexOf(".csv")), "_", line[i].Trim('"'));
               }

               List<System.Collections.Generic.List<string>> ObjListColumns = new List<List<string>>();
               //here
               for (int i = 1; i < line.Length; i++)
               {
                   ObjListColumns.Add(new List<string>());
               }

               string[] values = null;
               while (!ObjStreamReader.EndOfStream)
               {
                   values = null;
                   values = ObjStreamReader.ReadLine().Split(';');
                   for (int i = 0; i < ObjListColumns.Count; i++)
                   {
                       ObjListColumns[i].Add(values[i + 1]);
                   }
               }
               ObjStreamReader.Close();
               ObjStreamReader.Dispose();
               GC.Collect();

               for (int i = 0; i < ObjListColumns[0].Count; i++)
               {
                   ObjListColumns[0][i] = ObjListColumns[0][i].Trim('"').Trim('\\').Trim('"');
               }
               for (int i = 0; i < ObjListColumns.Count; i++)
               {
                   for (int j = 0; j < ObjListColumns[i].Count; j++)
                   {
                       ObjListColumns[i][j] = ObjListColumns[i][j].Trim('"');
                   }
               }
               ObjListFile.Add(workingfolderpath + "\\w" + file[file.Length - 1]);
               FileStream ObjFileStream = new FileStream(workingfolderpath + "\\w" + file[file.Length - 1], FileMode.OpenOrCreate);
               StreamWriter ObjWriter = new StreamWriter(ObjFileStream);

               string text = null;
               ObjWriter.WriteLine("[Data]");
               ObjWriter.WriteLine("Tagname;TimeStamp;Value;DataQuality");
               string[] datetime = null;
               for (int i = 2; i < line.Length; i++)
               {
                   for (int j = 0; j < ObjListColumns[i - 1].Count; j++)
                   {
                       text = null;
                       //text=line[i].ToString()+";"+ObjListColumns[0][j].ToString()+";"+ObjListColumns[i - 1][j].ToString()+";"+"Good";
                       int sec = 1 + j;
                       datetime = ObjListColumns[0][j].ToString().Split(' ');
                       datetime[0] = DateTime.Now.AddDays(-1).ToShortDateString();
                       text = line[i].ToString() + ";" + datetime[0] + " " + datetime[1] + ";" + ObjListColumns[i - 1][j].ToString() + ";" + "Good";
                       //text = line[i].ToString() + ";" + DateTime.Now.AddMinutes(-sec).ToString("M/d/yyyy HH:mm:ss") + ";" + ObjListColumns[i - 1][j].ToString() + ";" + "Good";
                       ObjWriter.WriteLine(text);
                   }
               }
               ObjWriter.Flush();
               ObjFileStream.Flush();
               ObjWriter.Close();
               ObjWriter.Dispose();
               ObjFileStream.Close();
               ObjFileStream.Dispose();
               GC.Collect();
               Microsoft.Office.Interop.Excel.Application ObjApplication = new Microsoft.Office.Interop.Excel.Application();
               Microsoft.Office.Interop.Excel.Workbook ObjWorkBook = ObjApplication.Workbooks.Open(workingfolderpath + "\\w" + file[file.Length - 1], 0, false, 5, "", "", false, XlPlatform.xlWindows, ";", true, false, 0, true, false, false);
               Microsoft.Office.Interop.Excel.Worksheet ObjWorkSheet = ObjApplication.ActiveWorkbook.ActiveSheet;
               ObjApplication.Columns["A:A"].Select();
               ObjApplication.Selection.TextToColumns(ObjApplication.Range["A1"], XlTextParsingType.xlDelimited, XlTextQualifier.xlTextQualifierNone, Type.Missing, Type.Missing, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
               ObjWorkSheet.SaveAs(workingfolderpath + "\\c" + file[file.Length - 1], Microsoft.Office.Interop.Excel.XlFileFormat.xlCSV);
               //ObjWorkBook.Save();
               //ObjWorkBook.Close();
               //ObjApplication.SaveWorkspace();

               GC.Collect();

               Process[] proc = Process.GetProcessesByName("EXCEL");
               proc[0].Kill();
               proc[0].Dispose();
               //Call MoveToHistorian()
               ObjListFile.Add(workingfolderpath + "\\c" + file[file.Length - 1]);
               MoveToHistorian(workingfolderpath + "\\c" + file[file.Length - 1]);

           }
           catch (Exception Obj)
           {
               //Call MoveToError()
               string[] file = _filename.Split('\\');
               MoveToError(workingfolderpath + "\\c" + file[file.Length - 1], Obj.Message);
           }
           finally
           {
               //Delete all the temporary files what an application has created from the working folder
               foreach (string filename in ObjListFile)
               {
                   if (File.Exists(filename))
                   {
                       File.Delete(filename);
                   }
               }
           }
       }

       public static Boolean IsFileLocked(FileInfo file)
       {
           FileStream stream = null;
           try
           {
               stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None);
           }
           catch (IOException)
           {
               return true;
           }
           finally
           {
               if (stream != null)
                   stream.Close();
           }
           return false;
       }

       public static void FindFileInProcessFolder()
       {
           foreach (string file in Directory.GetFiles(workingfolderpath))
           {
               if (file.EndsWith(".csv"))
               {
                   FileInfo ObjFileInfo = new FileInfo(file);
                   FileInfo ObjFileInUse = new FileInfo(workingfolderpath + "\\" + ObjFileInfo.Name);
                   if (!IsFileLocked(ObjFileInUse))
                   {
                       ProceesFile(ObjFileInUse.FullName);
                       break;
                   }
               }
           }
       }

       public static void MoveToHistorian(string _filename)
       {
           //Move a file to Historian Folder
           string[] file = _filename.Split('\\');
           if (File.Exists(_filename))
           {
               Process[] proc = Process.GetProcessesByName("EXCEL");
               if (proc.Length > 0)
               {
                   proc[0].Kill();
                   proc[0].Dispose();
               }

               File.Move(_filename, historianfolderpath + "\\" + file[file.Length - 1]);
           }
       }

       public static void MoveToError(string _filename, string _errormessage)
       {
           //Move a file to Error Folder
           //And update a error file with message, filename and timestamp
           string[] file = _filename.Split('\\');
           if (File.Exists(_filename))
           {
               Process[] proc = Process.GetProcessesByName("EXCEL");
               if (proc.Length > 0)
               {

                   proc[0].Kill();
                   proc[0].Dispose();
               }
               if (File.Exists(errorfolderpath + "\\" + file[file.Length - 1]))
               {
                   File.Delete(errorfolderpath + "\\" + file[file.Length - 1]);
               }
               File.Move(_filename, errorfolderpath + "\\"+ file[file.Length - 1]);
           }
           FileStream ObjFileStream = new FileStream(errorfolderpath + "\\" + "error.txt", FileMode.Append, FileAccess.Write);
           StreamWriter ObjWriter = new StreamWriter(ObjFileStream);
           ObjWriter.WriteLine(errorfolderpath + "\\" + file[file.Length - 1] + " = : " + DateTime.Now.ToString() + " : " + _errormessage);
           ObjWriter.Close();
           ObjFileStream.Close();

           Process[] proc1 = Process.GetProcessesByName("EXCEL");
           if (proc1.Length > 0)
           {
               proc1[0].Kill();
               proc1[0].Dispose();
           }


       }

       private void button1_Click(object sender, EventArgs e)
       {
           Form1.FindFileInProcessFolder();
       }

   }



Help me to find out why does it happen while debugging without break point.
Thanks You.

解决方案

The error is pretty self explanatory, you are trying to to something to a file while it is being used by some other process (probably trying to move or delete etc.)

If you don't know what file then add logging to you code to write the exception and associated information to a text file which you can read, like : Mini Drop-in Replacement for log4net[^]


We have a number of issues here, first of all i'd like to advocate for the seperation of concerns.

So you're anchoring in a windows form that should display, then you're provinding minitoring handling of folders, that's another concern and Then you appear to be monitoring for csv files using ';' as listseperator and when you find such get the columns and then recreate a csv type file with a firstline of "[Data]" which you then write to a work folder.
Finally you move on the making a new excel workbook and sort of paste into that and store it in your working folder.

Beyond that you're doing a lot of explict handling of GC thread, which really shouldn't be done ... like ever. And tryig to kill excel as a process and stuff. Also shouldn't be necessary.

Therefore i think you should beging by refctoring the identifyable parts from each other. And when you release your interop COM objects, use System.Runtime.InteropServices.Marshal.ReleaseComObject(ObjApplication); after having called .Quit()

My first guess is that between your workbook handling doesn't release timely before you attempt to MoveToHistorian. Do not do any GetProcessByName + Kill stuff, you already have a COM handle so use that, and please do get all your domaine name specifics into using statements instead, you're making all of us cross-eyed trying to read the lines :D

Anyway so getting rid of your COM instance should read after your ObjWorkSheet.SaveAs...

ObjApplication.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(ObjApplication);
//ObjWorkBook.Save();
//ObjWorkBook.Close();
//ObjApplication.SaveWorkspace();

//GC.Collect();

//Process[] proc = Process.GetProcessesByName("EXCEL");
//proc[0].Kill();
//proc[0].Dispose();
//Call MoveToHistorian()
ObjListFile.Add(workingfolderpath + "\\c" + file[file.Length - 1]);
MoveToHistorian(workingfolderpath + "\\c" + file[file.Length - 1]);



IMHO: You should really consider refactoring the entire thing, for instance your monitoring of directory could be using a FileSystemWatcher https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx[^]

Then the entire Excel handling and the usageof temp folders for it's own purposes should also sit in it's own sepearate class and finally your ui could subsribe to notifcations and perhaps own a (seperate?) class with a filesystemwatcher.
Currently you have a small program trying to do a lot at the same time which is unrelated to each other conceptually and then plumbing from apparent debugging like explicitly addressing garbage collector and process lifetime which should be removed.

I'm tempted to provide a rewrite, but i think these advice might just be enough to get you through

cheers!


Please see my past answer: how to compress the error 'it is already used by another process' in vb.net[^].

—SA


这篇关于该进程无法访问该文件,因为该文件正由另一个进程使用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆