我想要获得在内存中使用Application.ExecutablePath
在内存中运行的可执行文件的位置,并将其从当前位置删除,但是我得到错误The system cannot find the file specified
。如何处理文件名
据我了解,这是因为路径中的空间。我如何解决这个问题?下面是相关代码:
System.Diagnostics.Process p = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
psi.FileName = @"cmd.exe /C Del " + Path.GetFullPath(Application.ExecutablePath);
p.StartInfo = psi;
p.Start();
当您修复路径时,您可能会收到“使用中的文件”异常。 – 2012-03-14 12:17:07