C#调用dos命令

    using System.Diagnostics;

 

namespace WebApplication1

{

public partial class WebForm3 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

Process pro = new Process();

pro.StartInfo.UseShellExecute = false;

pro.StartInfo.FileName = "cmd";

pro.StartInfo.Arguments = "/c dir > d:\\2.txt";

pro.StartInfo.RedirectStandardOutput = false;

pro.Start();

}

}

}

 

posted @ 2009-04-30 09:40  许晓光  阅读(556)  评论(0编辑  收藏  举报