Code Examples
  Home arrow Code Examples arrow Understanding the CompressedFolder Class
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Understanding the CompressedFolder Class
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-03-18

    Table of Contents:
  • Understanding the CompressedFolder Class
  • Examining the Properties
  • More on Properties
  • Examining the Exposed Methods

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Understanding the CompressedFolder Class


    (Page 1 of 4 )

    In my last series I showed you how to create a custom object class in VBScript that could create compressed files natively. The intent was to demonstrate how to create and use the class rather than to explain the coding concepts. I decided to revisit the topic for a more thorough explanation.

    If you haven’t already, you should read my article about Compressed Folders.  It will provide a little more insight into the code we’ll be examining today.

    First let me explain my theory behind this object class.  I wanted an object that would represent a compressed folder (or zip file).  Much like the FileSystemObject’s or Shell Object’s Folder objects, I wanted my object to have a series of methods for adding and removing files, along with properties that would describe the file itself.  In retrospect, I would have liked to add a size property that would display the compressed folder’s size on disk.  Perhaps I’ll put that on my to-do list for the next revision.

    Once I had the concept, I made a quick list of the properties and methods that I would like my object to have.  This is a good way to get your code class headed in the right direction.  By making this list, you are able to organize your thoughts better.  You can see how your various properties and methods relate and what outside objects are required, among other things.  This can often help in coding the class itself, as you will have a much broader view of the code you’ll need to accomplish each of your tasks.  Remember that a code class is more than a script; it’s a small project in and of itself.

    Once I had the concept on paper, I was able to determine all of my prerequisites.  I knew that I needed the Shell object (along with an ADODB Stream) to create and manipulate compressed folders.  In order to implement some error handling, I’d need to check that files exist as well.  This is most easily done using the FileSystemObject.  It was important to me that I avoided using any objects that weren’t native to the scripting engine.  I also wanted to avoid diving into complicated WMI code, so I was off to a very good start.

    More Code Examples Articles
    More By Nilpo


     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT