⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program.cs

📁 windows mobile 6.0 on Motolola Q*** s reboot control program
💻 CS
字号:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace WMReboot
{
    class Program
    {
        public const string AppName = "WMReboot";
        public const string AppVer = "1.0";

        public const int IOCTL_HAL_REBOOT = 0x101003c;

        [DllImport("coredll.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize, ref int lpBytesReturned);

        static void Main(string[] args)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to reboot?", string.Format("{0} v{1}", AppName, AppVer), MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

            if (result == DialogResult.Yes)
            {
                Reboot();
            }
        }

        static private void Reboot()
        {
            int bytesReturned = 0;
            KernelIoControl(0x101003c, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -