按鈕單擊事件: 【結束QQ】
Process[] ps = Process.GetProcessesByName("qq");
if (ps != null)
{
foreach (Process p in ps)
{
// MessageBox.Show(p.StartTime.ToString());
p.Kill();
}
}
按鈕單擊事件:【獲取QQ安裝目錄】
string path = "";
Process[] ps = Process.GetProcessesByName("qq");
if (ps != null)
{
foreach (Process p in ps)
{
path = p.MainModule.FileName.ToString();
}
MessageBox.Show(path);
}