繁体   English   中英

通过执行Process.Start命令产生奇怪的消息

[英]Weird Messages by executing Process.Start command

我们有一个项目,该项目创建一个Excel文件并将其保存在网络共享驱动器中,然后打开该文件,应用程序运行正常,但出现奇怪的消息。 考虑以下代码

using Excel = Microsoft.Office.Interop.Excel;
....
xlsAppClass = new Excel.Application();
Process excelPID = GetExcelProcessId(xlsAppClass);

//
// All codes generate and save the excel file...
// and return the filePath which is located in Network Shared drive.
//

xlsWorkBook.Close();
xlsAppClass.Quit();
Marshal.ReleaseComObject(xlsSheets);
Marshal.ReleaseComObject(xlsWorksheet);
Marshal.ReleaseComObject(xlsWorkBook);
Marshal.ReleaseComObject(xlsAppClass);
if (excelPID != null) excelPID.Kill();

// When program reaches this line of code excel file created, saved and Excel process killed
// I checked the TaskManager, nothing's there.

然后我通过以下代码打开生成的文件

System.Diagnostics.Process.Start(filePath);

这时系统打开文件,但是我也收到以下消息,我无法弄清楚为什么“ Microsoft Office Communicator 2007已经在运行”

实际上,我重新启动了PC,问题已解决!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM