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 Pin
Dave Nelson
9:12 12 Oct '06  
GeneralUpdated NTFS.dll to 2.0 Pin
Moomansun
14:57 23 Aug '06  
QuestionRe: Updated NTFS.dll to 2.0 Pin
FrEaK_CH
6:10 21 Sep '06  
AnswerRe: Updated NTFS.dll to 2.0 Pin
Moomansun
8:59 21 Sep '06  
GeneralRe: Updated NTFS.dll to 2.0 Pin
FrEaK_CH
13:06 21 Sep '06  
GeneralRe: Updated NTFS.dll to 2.0 Pin
FrEaK_CH
13:03 25 Sep '06  
QuestionChanges in NTFS.dll? [modified] Pin
FrEaK_CH
7:21 7 Jun '06  


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