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 WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//实例一个process类
Process process = new Process();
//设定程序名
process.StartInfo.FileName = "cmd.exe";
//关闭Shell的使用
process.StartInfo.UseShellExecute = false;
//重新定向标准输入,输入,错误输出
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;