多个表单:form1失败但其他表单继续执行 [英] Multiple forms: form1 fails but the other forms continue to execute
问题描述
我有一个场景,我在表单应用程序中有4个表单。 form1创建一个文件夹,form2检查iis中端口号的可用性,form3在iis中创建一个新站点,表单4在iis中创建一个新的aplication pool。这里的问题是当表单1或form2或form3或form4失败时,我希望整个进程停止并返回到form1。但是这里发生的是即使表单1或表单2失败,其他表单继续执行也不会发生。
请帮助PLZ。非常感谢提前
Hi,
I have a scenario like where i have 4 forms in a forms application. form1 creates a folder, form2 checks for the availability of port number in iis, form3 creates a new site in iis, form 4 creates a new aplication pool in iis. The problem here is that when form 1 or form2 or form3 or form4 fails i want the entire process to get stopped and return to form1. but whats happening here is even if form 1 or form2 fails the other forms continue to execute which should not happen.
kindly help plz. Many thanks in advance
推荐答案
这个请求完全没有意义,因为返回,失败(异常?)和执行的概念与方法和线程有关'堆栈,而不是形式。表单不是要返回的方法。因此,您应该首先了解:1)方法,方法参数,方法返回,2)堆栈操作,3)结构化异常处理。如果你这样做,这样的顾虑会立即停止打扰你。
-SA
This request makes no sense at all, because the notions of return, failure (exception?) and execution are related to methods and the thread''s stack, not the form. A form is not a method to be returned. So, you should first learn: 1) methods, method parameters, method returns, 2) stack operation, 3) structured exception handling. If you do this, such concerns will immediately stop bothering you.
—SA
这篇关于多个表单:form1失败但其他表单继续执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!