惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
SecWiki News
SecWiki News
W
WeLiveSecurity
N
News | PayPal Newsroom
AI
AI
The Last Watchdog
The Last Watchdog
I
InfoQ
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
B
Blog RSS Feed
Hacker News: Ask HN
Hacker News: Ask HN
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 最新话题
Engineering at Meta
Engineering at Meta
Hacker News - Newest:
Hacker News - Newest: "LLM"
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
www.infosecurity-magazine.com
www.infosecurity-magazine.com
腾讯CDC
Attack and Defense Labs
Attack and Defense Labs
博客园 - Franky
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
Forbes - Security
Forbes - Security
Martin Fowler
Martin Fowler
D
Docker
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Privacy & Cybersecurity Law Blog
U
Unit 42
H
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Schneier on Security
博客园 - 司徒正美
S
SegmentFault 最新的问题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Schneier on Security
Schneier on Security
P
Palo Alto Networks Blog
Jina AI
Jina AI
V
Vulnerabilities – Threatpost
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学

博客园 - Allen Zhang

oracle数据库的字符集更改 用SQL server导出到oracle,查询时提示“表或视图不存在ORA-00942”错误 由于无法创建应用程序域,因此未能执行请求。错误: 0x80070002 系统找不到指定的文件 导出Excel时发生COM组件失败的解决方案 jquery下一个空格带来的血案 C++数据类型与C#对应关系 c#调用WINDWOS API时,非常有用(转) 水晶报表的交叉表中增加超级链接 JavaScript和ExtJS的继承 Ext.extend Ext.applyIf (转) SQL SERVER 2000数据库置疑处理 ScriptX控件部分参数说明 - Allen Zhang - 博客园 给ASP.net程序配置代理服务器 使用jQuery的validation后,无法引发asp.net按钮的事件处理程序 使用代码模拟请求和提交网页数据 - Allen Zhang - 博客园 C#调用Delphi写的动态链接库 - Allen Zhang - 博客园 近期一些超值文章及工具收集 用STSADM工具全自动备份sharepoint站点 创建MOSS网站下的新闻 SQL Server Reporting Services与MOSS集成资料汇总 修复MOSS2007备份还原后搜索服务出现的问题(续) - Allen Zhang - 博客园
Web应用系统中关闭Excel进程
Allen Zhang · 2011-10-31 · via 博客园 - Allen Zhang

在Web系统中调用Excel操作后,关闭Excel进程是个老问题

试了几种方法都无效,最后还是得采用kill进程的方案,不过跟强行kill所有Excel进程相比,下面的方案更为合理。

程序只kill当前对象相应的Excel进程。

[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId);

int lpdwProcessId;
GetWindowThreadProcessId(new IntPtr(app.Hwnd), out lpdwProcessId);
System.Diagnostics.Process.GetProcessById(lpdwProcessId).Kill();

特此备忘,省得以后碰到同类问题,又是一通google。