[DllImport("user32.dll", EntryPoint="ExitWindowsEx")]
public static extern int ExitWindows (
int dwReserved,
int uReturnCode
);或者:[DllImport("user32.dll")]
public static extern int ExitWindowsEx (
int dwReserved,
int uReturnCode
);
public static extern int ExitWindows (
int dwReserved,
int uReturnCode
);或者:[DllImport("user32.dll")]
public static extern int ExitWindowsEx (
int dwReserved,
int uReturnCode
);
解决方案 »
- (请教)VS2008左边除了[工具箱],[服务器资源管理器]选项卡外,[数据源]的选项卡在哪找?
- 异步socket时send数据包后EndReceive
- 急,出鬼了。。大家快救我。。
- 怎么写个c#程序代我自动登录某个网站(没有验证码)
- datagridview 排序后问题
- 导出word的问题 请指教
- text控件绑定DataSet的问题。
- 我想用C#编写上位机和下位机的通信,是USB连接的,没有思路哪位大神能帮我一下。。
- 怎么将vb声明转为C#的声明
- 请问我装的VS.NET beta2在使用帮助时总叫我放光盘,我只有把光盘放进去才看的见MSDN的内容,但当时我是完全安装,把整个MSDN都装进硬盘里了。请问如何解决,不放光盘也能看MSDN的内容?谢谢了。
- 不知不觉升了第一个小三角,向前辈们学习,散散分
- 如何将 字符串(字符串中是二进制的字符串形式) 转换成 二进制,有挑战性哦
我为何关不了机呀?应用什么参数?
class Class1
{
[DllImport("user32.dll")]
static extern bool ExitWindowsEx(uint uFlags, uint dwReason);
[STAThread]
static void Main(string[] args)
{
ExitWindowsEx(0, 0); //this will cause the computer to logoff.
ExitWindowsEx(1, 0); //And this will shutdown your computer.
}
}
关机可能与权限有关。
private static extern int ExitWindows (int dwReserved, int uReturnCode);