Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spinningcat/5154f118539bf4bf56c26585c35f87b4 to your computer and use it in GitHub Desktop.
Save spinningcat/5154f118539bf4bf56c26585c35f87b4 to your computer and use it in GitHub Desktop.
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();
}
}
}
using System;
using System.Diagnostics;
namespace processstudy
{
class Program
{
static void Main(string[] args)
{
ProcessWatch pW = new ProcessWatch();
pW.watch();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment