方法

Solution -> Properties -> Configuration Properties -> Linker -> Manifest File -> UAC Execution Level 更改为:requireAdministrator(/level='requireAdministrator')