Windows Mobile 软重启系统
来源:互联网 发布:wdcp php版本升级 编辑:程序博客网 时间:2024/04/30 21:34
在编写Windows Mobile上的应用系统时,因为特殊的业务需要,需要通过软件重启手机,.NET 托管API中不包含该接口,自己封装了一个。
public const uint FILE_DEVICE_HAL = 0x00000101;
public const uint METHOD_BUFFERED = 0;
public const uint FILE_ANY_ACCESS = 0;
public static uint CTL_CODE(uint DeviceType, uint Function, uint Method, uint Access)
{
return ((DeviceType << 16) | (Access << 14) | (Function << 2) | Method);
}
[System.Runtime.InteropServices.DllImport("Coredll.dll")]
public extern static uint KernelIoControl
(
uint dwIoControlCode,
IntPtr lpInBuf,
uint nInBufSize,
IntPtr lpOutBuf,
uint nOutBufSize,
ref uint lpBytesReturned
);
/// <summary>
/// 重启PPC操作
/// </summary>
/// <returns></returns>
public static uint ResetPocketPC()
{
uint bytesReturned = 0;
uint 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);
}
在使用的时候,直接调用ResetPocketPC即可。
- Windows Mobile 软重启系统
- Windows Mobile获取系统图片
- Windows Mobile获取系统图片
- windows Mobile系统初步了解
- windows mobile 系统学习 2
- Windows Mobile 05 系统数据库卷
- Windows mobile下获取系统图标
- Windows mobile 5.0系统中操纵EDB
- Windows mobile下获取系统图标
- Windows mobile下获取系统图标
- Windows Mobile 常用系统程序调用
- windows mobile系统 手机上网设置详解
- 调用Windows Mobile系统程序的方法
- Windows Mobile 6.5系统详细使用教程!
- windows mobile 中文系统 英文系统字体的区别
- windows mobile
- Windows Mobile
- Windows Mobile
- AS3获取Web传递的URL参数
- 告诉你什么是“五险一金”,花五分钟读一下不吃亏的
- ANN VS SVM
- WinCE虚拟串口驱动(一)
- JS正则表达式之符号解
- Windows Mobile 软重启系统
- Flash中如何显示清晰的字体
- ECCV 2010统计
- unsafe & fixed
- java 文件的各种操作
- Windows Mobile获取通话记录
- 我的网站之旅 (一)构思
- 面试,你回答过这些提问吗?
- HTTP POST GET 本质区别详解