Created
June 19, 2018 15:02
-
-
Save spinningcat/a30fe3eb8ee83979e1fb9da6d604e760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Text; | |
namespace processstudy | |
{ | |
class ProcessWatch | |
{ | |
public void watch() | |
{ | |
// Process.Start("cmd.exe"); | |
var process = new Process(); | |
// process.StartInfo.UseShellExecute = false; | |
// You can start any process, HelloWorld is a do-nothing example. | |
process.StartInfo.FileName = @"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"; | |
process.Start(); | |
process.WaitForExit(1000); | |
process.Kill(); | |
//Process.GetProcessById(process.Id).Kill(); | |
//Process.GetProcessById(process.Close).Kill(); | |
//process.StartInfo.CreateNoWindow = true; | |
//process.Start(); | |
//process.WaitForExit(10000); | |
//process.Kill(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment