[DllImport("coredll.dll", CharSet = CharSet.Auto)]
private extern static int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize, ref int lpBytesReturned);
[DllImport("coredll.dll", CharSet = CharSet.Auto)]
private void ResetCE()
{
int IOCTL_HAL_REBOOT = 0x101003C;
int bytesReturned = 0;
SetCleanRebootFlag();
KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned);
}
转载于:https://www.cnblogs.com/lppcoding/archive/2010/12/09/1901258.html