用于关闭,重新启动,睡眠,锁定,休眠和退出计算机的代码 [英] codes for shut down,restart,sleep,lock,hibernate andd log off the computer

查看:76
本文介绍了用于关闭,重新启动,睡眠,锁定,休眠和退出计算机的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我想在vb.net中制作一个程序,通过单击按钮来关闭计算机.
谁能告诉我关机,重新启动,睡眠,锁定,休眠和注销计算机的代码.
我只想关闭代码,请注意程序的代码
感谢

hi all
I wanna make a program in vb.net about shuting the computer down by click on a button.
can any one please tell me the codes for shut down,restart,sleep,lock,hibernate andd log off the computer.
i wanna just the code for shutting down note the code of the program
thanks

推荐答案

一种简单的方法:使用应用程序"shutdown.exe"并以System.Diagnostics.Process.Start开头.另一种方法是使用WMI.

参见:
http://stackoverflow.com/questions/1215139/reboot-machine-from-ac- wpf-app [ ^ ],
http://www.geekpedia.com/code36_Shut-down-system-using-Csharp.html [^ ].

—SA
One way is simple: use the application "shutdown.exe" and start it with System.Diagnostics.Process.Start. Another method is using WMI.

See:
http://stackoverflow.com/questions/1215139/reboot-machine-from-a-c-wpf-app[^],
http://www.geekpedia.com/code36_Shut-down-system-using-Csharp.html[^].

—SA


尝试此

http://users.telenet.be/jbosman/applications.html
try this

http://users.telenet.be/jbosman/applications.html


这篇关于用于关闭,重新启动,睡眠,锁定,休眠和退出计算机的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆