我正在使用以下代码从我的 c# 应用程序重新启动设备
[Flags]
public enum ExitFlags
{
Reboot = 0x02,
PowerOff = 0x08
}
[DllImport("coredll")]
public static extern int ExitWindowsEx(ExitFlags flags, int reserved);
ExitWindowsEx(ExitFlags.PowerOff, 0);
但是我收到以下错误:
Can't find an Entry Point 'ExitWindowsEx' in a PInvoke DLL 'coredll'.