我需要确定是否禁用了Windows,将其设置为必要的windows程序和服务或除我选择的程序之外的所有程序。
我一直在寻找一种方法来做这件事,但没有取得任何成功。有办法这样做吗?在C#中开发。
发布于 2013-12-05 16:10:55
public enum DepSystemPolicyType
{
AlwaysOff = 0,
AlwaysOn,
OptIn,
OptOut
}
[DllImport("kernel32.dll")]
static extern int GetSystemDEPPolicy();
public static void ValidateDepPolicy()
{
int policy = GetSystemDEPPolicy();
//here you can evaluate the return value
//against the enum DepSystemPolicyType
}MSDN文档:GetSystemDEPPolicy函数
https://stackoverflow.com/questions/20404854
复制相似问题