C,无冻结我的应用程序的GUI#运行过程 [英] c# run process without freezing my App's GUI
问题描述
我想启动一个进程(调用其他程序),目前外部程序需要一定的时间(这是正常的)!
I want to start a process (calling another program), currently the external program takes time (it is normal)!
但冻结我的GUI
口看到配发的例子,我学习,这是很难搞清楚,
试图阅读和学习线程,但它不是那么容易(至少对我来说)
和良好的简单教程或示例代码?
but it freezes my GUI I saw allot of examples and I'm learning, it is hard to figure it out, trying to read and learn threading, but it is not that easy (at least for me) and good simple tutorial or code sample?
欢呼声
推荐答案
下面是一个链接展示了如何使用异步方法。
http://www.codeproject.com/KB/cs/AsyncMethodInvocation.aspx
Here is a link showing how to use an asynchronous method. http://www.codeproject.com/KB/cs/AsyncMethodInvocation.aspx
您可以使用异步方法来启动程序,而它启动时不会冻结GUI。
You can use the asynchronous method to start the process, and it won't freeze the gui while it starts up.
void Your_Method()
{
//Start process here
}
MethodInvoker myProcessStarter= new MethodInvoker(Your_Method);
myProcessStarter.BeginInvoke(null, null);
这篇关于C,无冻结我的应用程序的GUI#运行过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!