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();
}
}
}