Click here to Skip to main content
Email Password   helpLost your password?

Introduction

Do you know what are NTFS Alternate Data Streams? If not, look at Accessing alternative data-streams of files on an NTFS volume, a Richard Deeming article. There you can download the sources and binaries of the NTFS.dll used in my project.

This project is a Windows GUI extension that allows you to Find and Remove all the interested data streams stored on your local drive or a network folder.

The data is returned in a DataGrid and you can sort it by stream name, size, location and file name.

Using the Form

The core of the form uses a recursive search, and each file found is stored into an ArrayList, and so is all the streams information of the file.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using NTFS;
using System.Threading;
...
private void DirSearch(string sDir, bool subFolders)
  {
   try
   {
    foreach (string f in Directory.GetFiles(sDir))
    { 
     FileInfo FSInfo = new FileInfo(f);
     NTFS.FileStreams FS = new NTFS.FileStreams(f);
      
     foreach(NTFS.StreamInfo s in FS)
     {
      FileInfoStruct fis;
      fis.File_Name = FS.FileName;
      fis.Stream_Name = s.Name;
      fis.Stream_Size = s.Size;
      fis.Location = FSInfo.DirectoryName;
      fis.Creation_Date = FSInfo.CreationTime;
      ArrayFileInfo.Add(fis);
     } 
    }
    // update the results label

    String caption = "Results:  (" + 
                     this.fileInfoData1.FileInfo.Rows.Count.ToString() + 
                     ")";
    this.dataGridResult.CaptionText = caption;
    if (subFolders)
    {
     foreach (string d in Directory.GetDirectories(sDir))
     {
      DirSearch(d, subFolders);
     }
    }
   }
   catch
   {
   }
  }
You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralADS on Directories
Dave Nelson
9:12 12 Oct '06  
How would I use this to find ADS on a folder instead of just files?

Atribune
GeneralUpdated NTFS.dll to 2.0
Moomansun
14:57 23 Aug '06  
I have updated the NTFS.dll to support .NET 2.0. The filestream used has been changed to support SafeFileHandle, rather than a handle to the file.

A little note to remember, if you try to run this in debug mode under Visual Studio 2005, the threads time out. Running the Release version works perfectly.

I've taken a look around for a freeware app which can list ADS and there is none. So, if there are no objections, I'll add a link to this page and release a compiled version of this very handy app as freeware.
QuestionRe: Updated NTFS.dll to 2.0
FrEaK_CH
6:10 21 Sep '06  
Hi

Where can I find your updated NTFS.dll?? I need it for my project where I would delete the ADS.

Can you help me?

Thanks a lot
Dominik
AnswerRe: Updated NTFS.dll to 2.0
Moomansun
8:59 21 Sep '06  
The compiled Dll is available with this freeware app:

Marx NTFS Alternate Data Streams Viewer v2
GeneralRe: Updated NTFS.dll to 2.0
FrEaK_CH
13:06 21 Sep '06  
Hi

Thank you for the link: But, is it possible that you can give me the source code from the NFTS.dll? Roll eyes

Dominik
GeneralRe: Updated NTFS.dll to 2.0
FrEaK_CH
13:03 25 Sep '06  
Sorry again...

But is it not possible to give us (me) the source code for the updated NTFS.dll? So that I must not do this also.... Roll eyes

Thanks,
Dominik
QuestionChanges in NTFS.dll? [modified]
FrEaK_CH
7:21 7 Jun '06  
Hi

Did you change something in the 'NFTS.dll' source code? (article: Accessing alternative data-streams of files on an NTFS volume)??

Thanks and Regards
Dominik


Last Updated 20 Oct 2005 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010