【问题标题】:how to perform cold-boot & warm-boot by C# code on windows-mobile 5.0?如何在 windows-mobile 5.0 上通过 C# 代码执行冷启动和热启动?
【发布时间】:2011-08-07 17:29:27
【问题描述】:

如何使用 C# for Windows Mobile 5.0 执行冷启动和热启动?

是否有任何程序可以在 windows-mobile 5.0 上运行命令提示符?

提前致谢

【问题讨论】:

    标签: c# windows-mobile-5.0


    【解决方案1】:
    [DllImport("coredll.dll")]
    
            public static extern int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize,ref int lpBytesReturned);
    
            private int CTL_CODE(int DeviceType, int Func, int Method, int Access)
    
            {           
    
               return (DeviceType << 16) | (Access << 14) | (Func << 2) | Method;
    
            }
            private int ResetPocketPC()
    
            {
                const int FILE_DEVICE_HAL = 0x101;
    
                const int METHOD_BUFFERED = 0;
    
                const int FILE_ANY_ACCESS = 0;
    
                int bytesReturned = 0;
    
                int IOCTL_HAL_REBOOT;
    
                IOCTL_HAL_REBOOT = CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS);
    
                return KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned);
    
            }
    

    更多信息和如何使用代码可以从CodeProject获得。 Psion Cummunity Blog 上还有另一篇很棒的文章,我强烈建议你也去看看。

    【讨论】:

      猜你喜欢
      • 2010-09-12
      • 1970-01-01
      • 1970-01-01
      • 2021-12-05
      • 2011-04-13
      • 1970-01-01
      • 1970-01-01
      • 2020-03-18
      • 2012-02-07
      相关资源
      最近更新 更多