Guest User

Untitled

a guest
Apr 6th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1.  static void Main(string[] args)
  2.         {
  3.  
  4.                 Process temp = new Process();
  5.  
  6.                 try
  7.                 {
  8.                     temp.StartInfo.FileName = @"D:\projects\add\Debug\add.exe";
  9.                     temp.StartInfo.Arguments = "1 2";
  10.                     temp.StartInfo.ErrorDialog = true;
  11.                     temp.Start();
  12.  
  13.                     temp.WaitForExit();
  14.  
  15.                     int result = temp.ExitCode;
  16.  
  17.                     Console.WriteLine("Ket qua la {0}", result);
  18.                 }
  19.                 catch (Exception)
  20.                 {
  21.  
  22.                     Console.WriteLine("Could not start process");
  23.                 }
  24.         }
Advertisement
Add Comment
Please, Sign In to add comment