Boki Digtal wrote:
> Hi All,
>
> I want to get MAC address by command line directly.
>
>
> private void Form1_Load(object sender, EventArgs e)
> {
> System.Diagnostics.Process Process3;
> Process3 = new System.Diagnostics.Process();
>
> String cmd = "ipconfig";
>
> Process3 = System.Diagnostics.Process.Start(cmd, ">
> mac_add.txt");
>
> Process3.WaitForExit();
> // Process3.Close();
> }
>
> but I get nothing when I perform it.
>
> Thank you!
>
> Best regards,
> Boki.
>
You are sending "> mac_add.txt" as a parameter to the program. That does
not redirect the output of the program.
Take a look at the ProcessStartInfo.RedirectStandardOutput property.
--
Göran Andersson
_____
http://www.guffa.com