Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Catalog Now!

0.00/5 (No votes)
10 Apr 2004 3  
Track all your files, locally, on CD-ROMs, and on removables.

Sample Image - catalognow.jpg

Introduction

Track all your files, locally, on CD-ROMs, and on removables. Then take these tiny catalogs with you, along with 'Catalog Now'!

Using the program

The main goal is the serialization of the following classes:

  [Serializable()]
  public class DirectoryCollection: SortedList
  {
    public DirectoryCollection() : base() {}
    public DirectoryCollection(IDictionary c) : base(c) {}
  }

  [Serializable()]
  public class FilesCollection: SortedList
  {
    public FilesCollection() : base() {}
    public FilesCollection(IDictionary c) : base(c) {}
  }

  [Serializable()]
  public class DirectoryItem
  {
    public DirectoryCollection subdir;
    public FilesCollection files;
    public string Name;
    public string Comment;
    public bool isCompressed = false;
    public DirectoryItem(string name)
    {
      Name = name;
      files = new FilesCollection();
      subdir = new DirectoryCollection();
    }
    public DirectoryItem(string name, bool iscompressed)
    {
      Name = name;
      isCompressed = iscompressed;
      files = new FilesCollection();
      subdir = new DirectoryCollection();
    }
  }

  [Serializable()]
  public class FileItem
  {
    public string Name;
    public long Size;
    public DateTime Date;
    public string Comment;
    public FileItem(string name, long size, DateTime date)
    {
      Name = name;
      Size = size;
      Date = date;
    }
    public FileItem(string name, long size, DateTime date, string comment)
    {
      Name = name;
      Size = size;
      Date = date;
      Comment = comment;
    }
  }

  [Serializable()]
  public class CatalogVersion
  {
    public string Version = "1.0";
  }

  [Serializable()]
  public class CatalogHeader
  {
    public string VolumeName;
    public string VolumeSerialNumber;
    public uint DriveType;
    public ulong Size;
    public ulong FreeSpace;
    public DateTime DateofScan;
  }

With the BinaryFormatter and the ICSharpCode.SharpZipLib.dll component, we can compress the catalog.

The scan of the devices is done with the optional read of compressed (.zip) files.

Sample screenshot

In order to look for a specific file, it is possible to look by name, commentary, date, size, etc.

Enjoy it!.

Credits

  • Thanks to Mike Krueger for his works with his #ziplib (SharpZipLib, formerly NZipLib, Zip, GZip, Tar and BZip2 library written entirely in C#).

History

  • 05/04/2004: Fix of permission bugs.
  • 04/04/2004: Initial version.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here