Click here to Skip to main content
Licence CPOL
First Posted 3 Apr 2004
Views 45,415
Bookmarked 30 times

Catalog Now!

By | 10 Apr 2004 | Article
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

sergiols

Web Developer

Argentina Argentina

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralCatalog Now moved Pinmembersergiols11:58 18 Jan '05  
GeneralRe: Catalog Now moved PinmemberJorgeCordero18:21 4 Aug '06  
GeneralGreat tool Pinmembersebasong1019:35 17 Aug '04  
GeneralGrande mono PinmemberGargolan17:22 28 Apr '04  
GeneralGenial!!! PinmemberMarkust5:07 6 Apr '04  
GeneralRe: Genial!!! Pinmembersergiols12:15 6 Apr '04  
GeneralProgram to help with your CD collection. PinsussAnonymous7:45 5 Apr '04  
GeneralRe: Program to help with your CD collection. Pinmembersergiols8:13 5 Apr '04  
GeneralDirectory Permission PinmemberSimon Wren1:14 5 Apr '04  
GeneralRe: Directory Permission Pinmembersergiols2:38 5 Apr '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 11 Apr 2004
Article Copyright 2004 by sergiols
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid