码迷,mamicode.com
首页 > 编程语言 > 详细

winform学习之----进程和线程

时间:2016-05-31 20:44:13      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

            Process[] pros = Process.GetProcesses();//获取多个进程
            foreach(var item in pros)
            {
                item.Kill();
                Console.Write(item);
            }

            Process.Start("calc");//打开计算器

            ProcessStartInfo psi = new ProcessStartInfo("@...");
            Process p = new Process();
            p.StartInfo = psi;
            p.Start();

           Thread th = new Thread(test);//开启线程
            th.Start();
            th.Abort();
            th.Start();

            if(th!=null)
            {
                th.Abort();//终止线程
            }

          //在.net下,不允许跨线程的访问处理办法:Control.CheckForIllegalCrossThreadCalls = false;

winform学习之----进程和线程

标签:

原文地址:http://www.cnblogs.com/candyzhmm/p/5547216.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!