现在的位置: 首页 > 综合 > 正文

[C#]启动外部程序

2011年07月24日 ⁄ 综合 ⁄ 共 644字 ⁄ 字号 评论关闭

            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)
            {
            }

抱歉!评论已关闭.