使用C#关闭PC

编程入门 行业动态 更新时间:2024-10-23 15:33:28
本文介绍了使用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 ExitWindowsEx [ ^ ]函数. 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

本文发布于:2023-11-17 07:26:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609294.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!