Private void button#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 processclass = new managementclass (scope, path, O );
Managementbaseobject inparams = processclass. getmethodparameters ("CREATE ");
Inparams ["CommandLine"] = commandbox. text;
Managementbaseobject outparams = processclass. invokemethod ("CREATE", inparams, null );
}
Catch (exception ee)
...{
MessageBox. Show (EE. message, "error ");
}
}
Private void button2_click (Object sender, system. eventargs E)
...{
Application. Exit ();
}
}