C#Form运行外部程序

1:首先先添加命名空间,using System.Diagnostics;

2:调用Process.Start()方法,括号里面写程序路径

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Process.Start(@"C:\Program Files\Tencent\QQ\Bin\QQ.exe");
        }
    }
}
 
原文地址:https://www.cnblogs.com/Rmeo/p/2578841.html