关于excel 导出进程关闭最有效的方法
2013-05-16 17:29
267 查看
[DllImport("User32.dll",CharSet= CharSet.Auto)]
public static extern int GetWindowThreadProcessId(IntPtr hwnd,out int ID);
//传入一个应用程序excel对象
public static void Kill(Excel.Application excel)
{
IntPtr t=new IntPtr(excel.Hwnd);
int k=0;
GetWindowThreadProcessId(t,out k);
System.Diagnostics.Process p= System.Diagnostics.Process.GetWindowThreadProcessById(k);
p.Kill();
}
public static extern int GetWindowThreadProcessId(IntPtr hwnd,out int ID);
//传入一个应用程序excel对象
public static void Kill(Excel.Application excel)
{
IntPtr t=new IntPtr(excel.Hwnd);
int k=0;
GetWindowThreadProcessId(t,out k);
System.Diagnostics.Process p= System.Diagnostics.Process.GetWindowThreadProcessById(k);
p.Kill();
}
相关文章推荐
- C#关闭excel进程的最有效方法
- c#关闭excel进程失败的解决方法
- 关于MVC控制器导出Excel时MemoryStream流已关闭的问题
- C#导出Excel后关闭进程(EXCEL.EXE)释放资源的解决方案
- 安全彻底关闭实例Excel.Application后产生的进程方法
- JAVA 关于web页面下载导出Excel通用方法
- C#关闭excel进程方法
- 关于.net创建excel文件关闭进程的奇怪现象
- 关于 WPF 在主窗口中用多线程打开的子窗口关闭后进程还存在,这个问的题的解决方法。
- 关于POI把数据库结果集导出到EXCEL和WORD的方法
- VB之操作excel后不能关闭excel进程的原因及解决方法
- C# 导出数据到Excel后,销毁Excel.exe进程的方法
- 关于 Excel 的结束进程的方法讨论
- asp.net 操作服务器Excel后,关闭服务器Excel进程有效方法
- 【转】.NET引用Excel操作时无法关闭Excel.exe进程的解决方法
- 关于js操作word和excel,js导出word和excel的若干方法汇总[转]
- 一个安全彻底关闭实例Excel.Application后产生的进程方法
- 安全彻底关闭实例Excel.Application后产生的进程方法
- 安全彻底关闭实例Excel.Application后产生的进程方法
- 关于GridView导出Excel的一些问题(采用Ajax出现的的问题及解决方法)