搜索文件的备用数据流 [英] Searching the Alternate Data Stream of files

查看:93
本文介绍了搜索文件的备用数据流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我需要构建一个允许某人在备用数据流文件中搜索字符串的应用程序。我们有文件(word,powerpoint,excel,text,.pdf),这些文件存储在备用数据流中。我试图找到一种方式
让用户在文本框中输入一个字符串,选择一个文件夹位置,然后让应用程序搜索所选目录中该字符串的每个文件。然后显示其流中包含该字符串的文件列表。 任何帮助或
的想法都表示赞赏。

I'm need to build an application that will allow someone to search for a string inside of the alternate data stream of files. We have files (word, powerpoint, excel, text, .pdf) that have XML stored in the alternate data streams. I'm trying to find a way to let a user enter a string into a text box, select a folder location, then have the application search through each file in the selected directory for that string. Then display a list of the files that have that string in their streams.  Any help or ideas is appreciated.

推荐答案

.NET不直接支持备用文件流。  NuGet上有第三方库可以添加对它的支持,例如
这个。您可以使用它来枚举流,然后访问内容。或者,您可以调用Win32本机支持它们。我认为NuGet中的包装器会更干净。

.NET doesn't support the alternate file streams directly.  There are third party libraries available on NuGet that add support for it such as this. You can use that to enumerate the streams and then access the contents. Alternatively you can just call to Win32 which supports them natively. I think the wrapper in NuGet would be cleaner.

有趣的是,PowerShell通过Get-Item和stream属性开箱即用。我没有看过实现。

Interestingly PowerShell does support this out of the box via Get-Item and the stream property. I haven't looked at the implementation though.


这篇关于搜索文件的备用数据流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆