Nasıl yapılır: komut satırı C#, Yürütme sonuçları STD ÇIK | Netgez.com
SORU
15 EKİM 2008, ÇARŞAMBA


Nasıl yapılır: komut satırı C#, Yürütme sonuçları STD ÇIK

Nasıl komut satırı programı C yerine ben# ve STD sonuçları. Özellikle, programlı olarak seçilen ve bir metin kutusu için sonuçları yazmak iki dosya üzerinde DİFF yürütmek istiyorum. Evet, Bunu kendim için anlamaya olabilir, ama başka biri böyle bir şey yaptı ki tembelim...

CEVAP
15 EKİM 2008, ÇARŞAMBA


// Start the child process.
 Process p = new Process();
 // Redirect the output stream of the child process.
 p.StartInfo.UseShellExecute = false;
 p.StartInfo.RedirectStandardOutput = true;
 p.StartInfo.FileName = "YOURBATCHFILE.bat";
 p.Start();
 // Do not wait for the child process to exit before
 // reading to the end of its redirected stream.
 // p.WaitForExit();
 // Read the output stream first and then wait.
 string output = p.StandardOutput.ReadToEnd();
 p.WaitForExit();

Kod MSDN.

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • DroidModderX ROOT Master

    DroidModderX

    14 ÅžUBAT 2011
  • Rozetked | Обзоры

    Rozetked | Ð

    5 AÄžUSTOS 2011
  • The Brister

    The Brister

    10 ÅžUBAT 2008