用stec.sfc.win32包吧,还是方便些。stec.sfc.win32包可在http://www.servertec.com/products/sfc/download.html下载。
如关机与重启
关机:
import stec.sfc.win32.system;
public class logoff
{
public static void main(string[] args)
{
try
{
system.logoff(true);
}
catch(exception ex) {}
}
}
如:重启
import stec.sfc.win32.system;
public class reboot
{
public static void main(string[] args)
{
try
{
system.reboot(true);
}
catch(exception ex) {}
}
}
闽公网安备 35060202000074号