Private void Button1_Click (Object Sender, System.Eventargs E)
{
ConnectionOptions Opt = New ConnectionOptions ();
Opt.username = Userbox.Text;
Opt.password = passbox.text;
Managementscope scope = new managementscope (" ipbox.text " // root // CIMv2 ", OPT);
Try
{
Scope.connect ();
ObjectgetOptions o = new objectGetoptions ();
ManagementPath Path = New ManagementPath ("Win32_Process");
ManagementClass ProcessClassClass (Scope, Path, O);
ManagementBaseObject INPARAMS = ProcessClass.getMethodparameters ("create");
INPARAMS ["CommandLine"] = CommandBox.Text;
ManagementBaseObject Outparams = ProcessClass.InvokeMethod ("Create", INPARMS, NULL);
}
Catch (Exception EE)
{
Messagebox.show (Ee.Message, "Error");
}
}
Private void button2_click (Object Sender, System.Eventargs E)
{
Application.exit ();
}
}