How Can i save the CMD Commands into txt file in C#
or how can i display command prompt in C#
here is my code
private void button1_Click(object sender, EventArgs e)
{
var p = new Process();
string path = @"C:\Users\Microsoft";
string argu = "-na>somefile.bat";
ProcessStartInfo process = new ProcessStartInfo("netstat", argu);
process.RedirectStandardOutput = false;
process.UseShellExecute = false;
process.CreateNoWindow = false;
Process.Start(process);
p.StartInfo.WorkingDirectory = path;
p.StartInfo.FileName = "sr.txt";
p.Start();
p.WaitForExit();
}