using System;
using System.IO;
using System.Diagnostics;
public class Program
{
public static void Main()
{
Process[] p = Process.GetProcessesByName("notepad");
if (p.Length > 0)
{
if (!p[0].HasExited)
{
if (p[0].Responding)
{
p[0].CloseMainWindow();
}
else
{
p[0].Kill();
}
}
}
}
}
沒有留言:
張貼留言