使用C#关闭PC [英] shutdown a pc ussing c#??
本文介绍了使用C#关闭PC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi ppl
我有一个我必须做的学校项目....,我选择了另一个(服务器/客户端)远程计算机
我需要一些帮助来关闭客户端的计算机(服务器)
我只需要知道我必须在服务器程序中做的工作,剩下的就由我做...我的意思是,如果有人可以帮助我,我会很高兴:)
thx
请注意,它是如此重要
hi ppl
i have a school project that i have to do ....and i chose to remote a computer by another (server/client)
and i need some help in shutting down a pc (the server) by the client
i just need to know wut i have to do in the server program and i''ll do the rest ...i mean i''ll be happy if somebody can help me:)
thx
plz it''s so important
推荐答案
可以使用P/Invoke和user32.dll ^ ]函数.
WMI中可能有一种方法,您也可以尝试使用 shutdown.exe [
It can be done using P/Invoke and the user32.dll ExitWindowsEx[^] function.
There may be a way in WMI, you could also try using shutdown.exe[^]
Process.Start("shutdown","/s /t 0");
这篇关于使用C#关闭PC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文