Jump to content

kill a process from taskmanager in c#/vb.net


siri

Recommended Posts

Hi,I want to terminate IE if IE instance is running .I tried the following code snippet but not getting how to terminate the process***********************************using System.Runtime.InteropServices;Type t=Type.GetTypeFromProgId("winmgmts:");object obj;object[] parameter = new object[1];parameter[0]="Select * from Win32_process";obj = Activator.CreateInstance(t);foreach(object o in t.InvokeMember("ExecQuery",BindingFlags.InvokeMethod,null, obj,parameter);{MessageBox.Show(o.toString());}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...