使用EnumWindows查找特定标题并关闭它 [英] using EnumWindows to find specific title and closing it
问题描述
我有一个SSIS包,它执行一些语句,当它们被执行时,我得到一个错误窗口。我需要一个脚本来检查所有窗口,并在运行过程中找到错误窗口,并在出现时自动关闭它。
我看了2套代码但我真的不知道如何在我的SSIS包中的脚本任务中使用它们。我是c#的新手,如果有人可以帮助我,我将不胜感激。以下是两个代码的链接。
如何使用EnumWindows查找具有特定标题/标题的窗口?
http://www.tcx.be/blog/2006/list-open-windows/
错误窗口标题为致命错误 。
提前致谢。
I have an SSIS package that executes some statements and while they are being executed I get an error window. I need a script that will check all windows and find the error window during the run process and close it automatically when it appears.
I have looked at 2 sets of code but i really dont know how to use them within my script task in my SSIS package. I am a new to c# so would be grateful if someone can help me out. Following are the links to both the codes.
How can I use EnumWindows to find windows with a specific caption/title?
http://www.tcx.be/blog/2006/list-open-windows/
The error window title is "Fatal Error".
Thanks in advance.
推荐答案
选择您要使用的任何代码集并将其构建为DLL。 文章 [ ^ ]将告诉你如何。
这个博客文章 [ ^ ]详细说明接下来要做什么从SSIS包中调用它。
就个人而言,我认为这完全是解决问题的错误方法。
查找导致错误的原因并修复它
OR
使用Try-Catch 处理错误 [ ^ ]以有意义的方式
Choose whichever of the sets of code you want to use and build it into a DLL. This article[^] will show you how.
This blog article[^] details what to do next to be able to call it from the SSIS package.
Personally, I think this is entirely the wrong way to address the problem.
Find what is causing the error and fix it
OR
Use Try-Catch to handle the error[^] in a meaningful way
这篇关于使用EnumWindows查找特定标题并关闭它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!