<legend id='1Xl9x'><style id='1Xl9x'><dir id='1Xl9x'><q id='1Xl9x'></q></dir></style></legend><tfoot id='1Xl9x'></tfoot>

    <small id='1Xl9x'></small><noframes id='1Xl9x'>

      <bdo id='1Xl9x'></bdo><ul id='1Xl9x'></ul>

      <i id='1Xl9x'><tr id='1Xl9x'><dt id='1Xl9x'><q id='1Xl9x'><span id='1Xl9x'><b id='1Xl9x'><form id='1Xl9x'><ins id='1Xl9x'></ins><ul id='1Xl9x'></ul><sub id='1Xl9x'></sub></form><legend id='1Xl9x'></legend><bdo id='1Xl9x'><pre id='1Xl9x'><center id='1Xl9x'></center></pre></bdo></b><th id='1Xl9x'></th></span></q></dt></tr></i><div id='1Xl9x'><tfoot id='1Xl9x'></tfoot><dl id='1Xl9x'><fieldset id='1Xl9x'></fieldset></dl></div>
    1. 如何在 C# 中使用 WMI 查询从 UWF 获取注册表和文件排除项

      How to get registry and file exclusions from UWF using WMI query in C#(如何在 C# 中使用 WMI 查询从 UWF 获取注册表和文件排除项)

    2. <legend id='DV4R8'><style id='DV4R8'><dir id='DV4R8'><q id='DV4R8'></q></dir></style></legend>
            <tbody id='DV4R8'></tbody>
          • <i id='DV4R8'><tr id='DV4R8'><dt id='DV4R8'><q id='DV4R8'><span id='DV4R8'><b id='DV4R8'><form id='DV4R8'><ins id='DV4R8'></ins><ul id='DV4R8'></ul><sub id='DV4R8'></sub></form><legend id='DV4R8'></legend><bdo id='DV4R8'><pre id='DV4R8'><center id='DV4R8'></center></pre></bdo></b><th id='DV4R8'></th></span></q></dt></tr></i><div id='DV4R8'><tfoot id='DV4R8'></tfoot><dl id='DV4R8'><fieldset id='DV4R8'></fieldset></dl></div>
            <tfoot id='DV4R8'></tfoot>
              <bdo id='DV4R8'></bdo><ul id='DV4R8'></ul>

                <small id='DV4R8'></small><noframes id='DV4R8'>

                本文介绍了如何在 C# 中使用 WMI 查询从 UWF 获取注册表和文件排除项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想使用 WMI 从 UWF 获取所有注册表排除和文件排除.

                I want to get all registry exclusion and file exclusion from UWF, using the WMI.

                我已经尝试从 UWF_RegistryFilter 类调用 GetExclusions 方法,但没有成功.

                I've already tried to invoke GetExclusions methods from UWF_RegistryFilter class but of no luck.

                我期待一个有效的示例代码,提前感谢您的帮助!

                I am looking forward to a working sample code, thanks in advance for any help!

                推荐答案

                难点是从方法结果中读取出参数.Microsoft 网站 很难猜测如何使用 ManagementBaseObject 来读取输出参数.

                The difficult part is to read the out parameters from the method result. There is no appropriate documentation available on Microsoft website and it's difficult to guess how ManagementBaseObject can be utilized for reading the out parameters.

                为了找到解决方案,我尝试根据其他有据可查的 wmi 示例了解 WMI 如何利用 out 参数.请使用下面的C#代码,希望对您有所帮助:

                In order to reach to a solution, I tried to develop an understanding of how WMI makes use of out parameters based on other well-documented wmi samples. Please use the C# code below, I hope it helps:

                public static void GetRegistryExclusions()
                    {
                
                        ManagementScope scope = new ManagementScope(@"rootstandardcimv2embedded");
                        using (ManagementClass mc = new ManagementClass(scope.Path.Path, "UWF_RegistryFilter",
                        null))
                        {
                            ManagementObjectCollection moc = mc.GetInstances();
                            foreach (ManagementObject mo in moc)
                            {
                                ManagementBaseObject[] result = (ManagementBaseObject[])mo.InvokeMethod("GetExclusions", null, null).Properties["ExcludedKeys"].Value;
                
                                if (result != null)
                                {
                                    foreach (var r in result)
                                    {
                                        Console.WriteLine(r.GetPropertyValue("RegistryKey"));
                                    }
                                }
                            }
                        }
                    }
                

                注意/请求请求具有 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.

                1. UWF
                2. UWFMGR

                这篇关于如何在 C# 中使用 WMI 查询从 UWF 获取注册表和文件排除项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)
                1. <legend id='Xe4eD'><style id='Xe4eD'><dir id='Xe4eD'><q id='Xe4eD'></q></dir></style></legend>

                2. <tfoot id='Xe4eD'></tfoot>
                  • <i id='Xe4eD'><tr id='Xe4eD'><dt id='Xe4eD'><q id='Xe4eD'><span id='Xe4eD'><b id='Xe4eD'><form id='Xe4eD'><ins id='Xe4eD'></ins><ul id='Xe4eD'></ul><sub id='Xe4eD'></sub></form><legend id='Xe4eD'></legend><bdo id='Xe4eD'><pre id='Xe4eD'><center id='Xe4eD'></center></pre></bdo></b><th id='Xe4eD'></th></span></q></dt></tr></i><div id='Xe4eD'><tfoot id='Xe4eD'></tfoot><dl id='Xe4eD'><fieldset id='Xe4eD'></fieldset></dl></div>

                    <small id='Xe4eD'></small><noframes id='Xe4eD'>

                          <tbody id='Xe4eD'></tbody>
                          <bdo id='Xe4eD'></bdo><ul id='Xe4eD'></ul>