[C#]启动外部程序


            System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
            //设置外部程序名
            Info.FileName = "Update.exe";
            Info.WorkingDirectory = Application.StartupPath;
            //声明一个程序类
            System.Diagnostics.Process Proc = new System.Diagnostics.Process();
            Proc.EnableRaisingEvents = true;
            Proc.Exited += new EventHandler(Proc_Exited);
           
            try
            {
                //
                //启动外部程序
                //
                Proc.StartInfo = Info;
                Proc.Start();

            }
            catch (System.ComponentModel.Win32Exception ex)
            {
            }

posted on 2010-02-21 16:47  BoneKing  阅读(190)  评论(0)    收藏  举报