110,021
社区成员




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace Shell
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ProcessStartInfo info = new ProcessStartInfo(textBox1.Text);
try
{
Process pro = Process.Start(info);
this.Dispose(true);
}
catch (Exception ee)
{
MessageBox.Show(ee.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Dispose(true);
}
private void button3_Click(object sender, EventArgs e)
{
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = "可执行文件|*.exe|所有文件(*.*)|*.*";
DialogResult DR = openFileDialog1.ShowDialog();
if (DR == DialogResult.OK) textBox1.Text = openFileDialog1.FileName;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text == string.Empty) button1.Enabled = false;
else button1.Enabled = true;
}
}
}