none
Discover Alternate Data Stream Names

    问题

  • Anyone know how to enumerate and discover alternate data streams using vb for a file where you do not know the stream names?

    If you want something you've never had, you need to do something you've never done.


    2012年8月16日 20:21

答案

  • Well, unfortunatly I was unable to utilize the example you provided, but I was however able to find an example online and convert it to vb.nt, in case anyone else finds this topic interesting...

    http://www.codeproject.com/Articles/2670/Accessing-alternative-data-streams-of-files-on-an

    Imports Trinet.Core.IO.Ntfs
    Imports System.IO
    Imports System.Text
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Path As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\bob2.txt"
            Dim AlternateDataStreamNames As New List(Of String)
            Dim SB As New StringBuilder
            Dim File As FileInfo = GetAlternateDataStreamNames(Path)
            For Each s As AlternateDataStreamInfo In File.ListAlternateDataStreams()
                SB.Append(s.ToString & vbCrLf)
            Next
            TextBox1.Text = SB.ToString
        End Sub
        Function GetAlternateDataStreamNames(ByVal Path As String) As FileInfo
            Dim file As New FileInfo(Path)
            Return file
        End Function
    End Class


    If you want something you've never had, you need to do something you've never done.


    2012年8月16日 21:17

全部回复

  • Hi Paul,

    I think this article describes what you need, but it uses API calls, and it's from 2006:

    Iterating NTFS Streams

    Maybe you find more when searching for FindFirstStreamW.


    Armin


    2012年8月16日 20:30
  • Can you show me a vb example?

    If you want something you've never had, you need to do something you've never done.

    2012年8月16日 20:43
  • I've googled only. :)

    Armin

    2012年8月16日 20:48
  • Well, unfortunatly I was unable to utilize the example you provided, but I was however able to find an example online and convert it to vb.nt, in case anyone else finds this topic interesting...

    http://www.codeproject.com/Articles/2670/Accessing-alternative-data-streams-of-files-on-an

    Imports Trinet.Core.IO.Ntfs
    Imports System.IO
    Imports System.Text
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Path As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\bob2.txt"
            Dim AlternateDataStreamNames As New List(Of String)
            Dim SB As New StringBuilder
            Dim File As FileInfo = GetAlternateDataStreamNames(Path)
            For Each s As AlternateDataStreamInfo In File.ListAlternateDataStreams()
                SB.Append(s.ToString & vbCrLf)
            Next
            TextBox1.Text = SB.ToString
        End Sub
        Function GetAlternateDataStreamNames(ByVal Path As String) As FileInfo
            Dim file As New FileInfo(Path)
            Return file
        End Function
    End Class


    If you want something you've never had, you need to do something you've never done.


    2012年8月16日 21:17
  • For anyone else who's interested in this subject, you can download my project here: ***Fixed

    Paul's Skydrive - AlternateDataStreamTool.zip


    If you want something you've never had, you need to do something you've never done.


    2012年8月17日 2:30