Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spinningcat/a30fe3eb8ee83979e1fb9da6d604e760 to your computer and use it in GitHub Desktop.
Save spinningcat/a30fe3eb8ee83979e1fb9da6d604e760 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();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment