C#在2008怎么实现关机

[复制链接]
查看11 | 回复2 | 2010-11-27 11:40:13 | 显示全部楼层 |阅读模式
C#在2008怎么实现关机

回复

使用道具 举报

千问 | 2010-11-27 11:40:13 | 显示全部楼层
先引用using System.Runtime.InteropServices;using System.Management;程序:[DllImport("user32.dll", EntryPoint = "ExitWindowsEx", CharSet = CharSet.Ansi)]
private static extern int ExitWindowsEx(int uFlags, int dwReserved);//上面两句请加上
//实现注销
private void button1_Click(object sender, EventArgs e)
回复

使用道具 举报

千问 | 2010-11-27 11:40:13 | 显示全部楼层
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; u
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行