Click here to Skip to main content
15,892,697 members
Articles / Programming Languages / C#
Article

Catalog Now!

Rate me:
Please Sign up or sign in to vote.
3.11/5 (17 votes)
10 Apr 2004CPOL 58K   340   32   10
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:

C#
[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)


Written By
Web Developer
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralCatalog Now moved Pin
sergiols18-Jan-05 11:58
sergiols18-Jan-05 11:58 
GeneralRe: Catalog Now moved Pin
Sebasthian4-Aug-06 18:21
Sebasthian4-Aug-06 18:21 
GeneralGreat tool Pin
sebasong1017-Aug-04 19:35
sebasong1017-Aug-04 19:35 
GeneralGrande mono Pin
Gargolan28-Apr-04 17:22
Gargolan28-Apr-04 17:22 
GeneralGenial!!! Pin
Markust6-Apr-04 5:07
Markust6-Apr-04 5:07 
GeneralRe: Genial!!! Pin
sergiols6-Apr-04 12:15
sergiols6-Apr-04 12:15 
Gracias, al programa necesitaba agregarle la serialización a XML, dado que la serialización binaria ocupa mucho espacio, y XML comprimido con ZIP sería lo más óptimo.
Si tienes idea como agregarle esta serialización a catalognow avisame.

Saludos,
Sergiols

GeneralProgram to help with your CD collection. Pin
Anonymous5-Apr-04 7:45
Anonymous5-Apr-04 7:45 
GeneralRe: Program to help with your CD collection. Pin
sergiols5-Apr-04 8:13
sergiols5-Apr-04 8:13 
GeneralDirectory Permission Pin
Simon Wren5-Apr-04 1:14
professionalSimon Wren5-Apr-04 1:14 
GeneralRe: Directory Permission Pin
sergiols5-Apr-04 2:38
sergiols5-Apr-04 2:38 

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

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