|
|
От: |
Rosigma
|
http://rosigma.com/ |
| Дата: | 06.05.08 17:45 | ||
| Оценка: | |||
protected void btnUnloadAll_Click(object sender, EventArgs e)
{
try
{
// unsafe
{
Process[] runningProcs = Process.GetProcessesByName("hangapp");
foreach (Process p in runningProcs)
{
p.Kill();
}
}
lblMessage.Text = "All servers have been successfully unloaded!";
}
catch (Exception ex)
{
lblMessage.Text = ex.ToString();
}
}System.ComponentModel.Win32Exception: Access is denied at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.Kill() at _Default.btnUnloadAll_Click(Object sender, EventArgs e)