Click here to Skip to main content
15,888,170 members
Please Sign up or sign in to vote.
2.44/5 (3 votes)
See more:
how to connect two laptops through wifi using c# and how to shutdown connected laptops using c# .
please help me
Posted

1 solution

Use WMI. The Win32_OperatingSystem class has a Win32Shutdown method. That's what you need. To generate the WMI code you could youse the WMI Code Creator tool by microsoft. Link: https://www.microsoft.com/en-us/download/details.aspx?id=8572[^]

WMI documentation for the mentioned method:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa394058%28v=vs.85%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900