打开外部程序

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 WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {

        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Title = "sample";
            dlg.ShowReadOnly = true;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string filename = dlg.FileName;
                Process.Start(filename);
             

            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

原文地址:https://www.cnblogs.com/softimagewht/p/2195865.html