System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcesses();
for (int i = 0; i < process.Length; i++)
{
string a = process[i].ProcessName.ToString();
if ((process[i].ProcessName == "CommandSend") || (process[i].ProcessName == "CommandSend.vshost"))
{
process[i].Kill();
}
}
在web.config中加入
<identity impersonate="true" userName="Administrator" password="123456" />
即可