【问题标题】:Getting a list of excluded extensions for windows search (SystemIndex)获取 Windows 搜索的排除扩展列表 (SystemIndex)
【发布时间】:2022-09-24 12:01:35
【问题描述】:

我想检索从搜索索引中排除的扩展名列表。试过这个

using Microsoft.Search.Interop;

CSearchManager csm=new CSearchManager();
ISearchCatalogManager iscm = csm.GetCatalog(\"SystemIndex\")
Microsoft.Search.Interop.IEnumString ies = iscm.EnumerateExcludedExtensions();

但事实证明 EnumerateExcludedExtensions 没有实现。

有人知道替代路线吗?

谢谢

    标签: c# windows-search


    【解决方案1】:

    以下确实有效,使用标记的 get/set-able bool IExtensions.IncludedExtensions 在明显的默认值下检索排除的扩展。

    好奇地看到尝试将该 bool 设置为 true 以获取包含的扩展而不是生成 accessdenied 错误,并进一步以管理员身份运行,这是一个未实现的错误。我找不到实际的文档。

    这在我的测试中适用于 Win 7 和 Win 10,但无论如何都必须在 try 块中发布,如果它破坏了线路,在我的情况下并不重要,只是成为一个缺失的功能。

    using MSSCTLB; // C:\Windows\System32\mssrch.dll "Microsoft Search CoClasses Type Library"
    
    CGatheringManager gm=new CGatheringManager();
    IExtensions iexs = gm.GatherApplications["Windows"].GatherProjects["SystemIndex"].Gather.Extensions;
    
    
    foreach (IExtension item in iexs)  listBox1.Items.Add(item.Extension);
    
    

    此外,扩展接口可以在 MSSITLB,“Microsoft 搜索接口类型库” “C:\Windows\System32\mssitlb.dll”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-07
      • 2019-07-18
      • 1970-01-01
      • 1970-01-01
      • 2014-04-04
      • 2022-06-30
      • 1970-01-01
      相关资源
      最近更新 更多