如何知道 UWF 是启用还是禁用 [英] How to know if UWF is enabled or disabled
本文介绍了如何知道 UWF 是启用还是禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何知道 UWF 是启用还是禁用?我正在使用 C# 制作应用程序,因此我需要了解该语言.
How do I know if the UWF is enabled or disabled? I'm making an application with C # so I need to know for that language.
谢谢
推荐答案
在考虑 UWF 是启用还是禁用时,有几点需要牢记:
There are few things to keep in mind when considering whether UWF is enabled or disabled:
- 启用 UWF 时未启用保护,您需要使用 UWF_Volume 类.
- 启用或禁用 UWF 后需要重新启动系统才能应用更改.UWF_Filter 类提供启用/禁用方法以及执行系统的重启/关闭.
- Protection is not enabled when UWF is enabled, you need to exlicitly turn it ON by making use of Protect method in UWF_Volume class.
- A system reboot is required after enabling or disabling of UWF in order to apply the changes. UWF_Filter class provides methods for enable/disable and for performing reboot/shutdown of the system.
下面的 C# 代码演示了 UWF_Filter 类的 CurrentEnabled 属性的使用:
The C# code below demonstrates the use of CurrentEnabled property of UWF_Filter class:
public static bool IsEnabled()
{
try
{
//root\standardcimv2\embedded
ManagementScope scope = new ManagementScope(@"root\standardcimv2\embedded");
using (ManagementClass mc = new ManagementClass(scope.Path.Path, "UWF_Filter",
null))
{
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
// Please make use of NextEnabled property in case you have enabled the UWF_Filter in the current session.
//The value in CurrentEnabled is populated only when the UWF_Filter was enabled on system boot.
return (bool)mo.GetPropertyValue("CurrentEnabled");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
return false;
}
注意/请求:请求具有 1500 声望的人创建并链接以下标签,以便像我这样的人可以更轻松地在 stackoverflow 上请求解决方案/回答问题.
Note/Request: Request someone with 1500 reputation to create and link following tags so that it becomes easier for people like me to request solutions/answer questions on stackoverflow.
- 世界自然基金会
- UWFMGR
这篇关于如何知道 UWF 是启用还是禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文