BackgroundWorker
来源:互联网 发布:电脑群发短信软件 编辑:程序博客网 时间:2024/06/10 18:48
BackgroundWorker的事件响应函数:
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; demoProcess = new Process(); Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); ProcessStartInfo info = new ProcessStartInfo(Assembly.GetEntryAssembly().GetName().Name + ".exe"); info.Arguments = string.Join(" ", (string[])e.Argument); info.RedirectStandardOutput = true; info.UseShellExecute = false; info.CreateNoWindow = true; demoProcess.StartInfo = info; demoProcess.Start(); while (demoProcess != null && !demoProcess.StandardOutput.EndOfStream) { if (worker.CancellationPending == true) { e.Cancel = true; break; } string message = demoProcess.StandardOutput.ReadLine(); if (this.InvokeRequired) this.Invoke(new AddItemHander(AddItem), message); else AddItem(message); } //at this stage application has finished and we can leave this worker... //but let's do cleaning work anyway if (!IsStoppingAnalysisByUser) { CleanDemoProcess(String.Empty); } else { IsStoppingAnalysisByUser = false; } }
- BackgroundWorker
- BackgroundWorker
- BackgroundWorker
- BackgroundWorker
- .NET BackgroundWorker
- About BackgroundWorker
- BackgroundWorker 类
- BackgroundWorker 类
- BackgroundWorker 类
- BackgroundWorker 类
- backgroundworker类
- 再小谈backgroundWorker
- BackgroundWorker类
- BackgroundWorker 组件
- BackgroundWorker组件
- 多线程---BackgroundWorker
- BackgroundWorker 类
- BackgroundWorker 类
- 自己动手写一个推荐系统
- c++第十六周任务阅读程序(一)
- Android 系统关机流程分析
- 数学之路(3)-模糊数学(10)
- centos5.2内核定制编译
- BackgroundWorker
- SSI 架构
- 填报表实现暂存,入库,取消功能
- 关于error LNK2019: unresolved external symbol错误
- trimLeft()trimRight()
- centos6.2内核定制编译
- cocos2d入门过程
- Sharepoint 2010 搜索服务配置(1)
- Linux 互斥锁的实现