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-05-27 14:03  iDEAAM  阅读(364)  评论(1编辑  收藏  举报