5
A
回答
5
您必须添加引用的Shell32.dll(COM - > “微软壳牌控制和自动化”),并使用此代码:
Shell32.Shell shell = new Shell32.Shell();
shell.ShutdownWindows();
2
添加引用C:\ WINDOWS \ SYSTEM32 \ Shell32.dll中。执行此操作后,请使用以下代码:
Shell32.ShellClass sc = new Shell32.ShellClass();
sc.ShutdownWindows();
这将正常显示关机对话框。
相关问题
- 1. 如何关闭事件YesNo Alert Box?
- 2. Python Box-SDK JWT Exp计算关闭?
- 3. Windows Azure关闭
- 4. 防止Windows关闭
- 5. Windows窗体:关闭,但不关闭
- 6. C#Windows窗体:关闭时[进程]
- 7. Windows C++ - 用CloseHandle关闭线程
- 8. C#Windows窗体应用程序关闭
- 9. 防止Windows关闭取消选项C#
- 10. Java关闭Windows关机
- 11. Windows窗体关闭后不关闭?
- 12. 如何在Windows关闭时关闭FiddlerCore
- 13. Windows 2000关闭程序关闭
- 14. Windows服务关闭
- 15. 关闭在C#
- 16. C#关闭StreamWriter
- 17. C#FileLogTraceListener关闭
- 18. C#Windows应用程序阻止Windows关闭/注销
- 19. 在Windows关闭之前关闭我的程序
- 20. c#windows无法关闭应用程序在关机
- 21. 关闭窗体关闭SQL连接(C#)
- 22. 用Windows事件关闭JFrames
- 23. 使用Java关闭Windows
- 24. 关闭Windows Phone闹钟
- 25. Windows窗体不关闭
- 26. 远程关闭Windows机器
- 27. 关闭套接字和Windows
- 28. 关闭Windows应用程序
- 29. windows 7 phone - 关闭键盘
- 30. C++开关线关闭
它在这里某处:http://msdn.microsoft.com/en-us/library/windows/desktop/ff818516%28v=vs.85%29.aspx –
如果你只是想要登录用户关: [SO注销编程] [1] [1]:http://stackoverflow.com/questions/484278/log-off-user-from-win-xp-programmatically-在-C-尖锐 –