ExamineWeb.aspin great detail. In this part, we are going to focus on the remainder of the code. As always, let's dive on into the code!
We begin by declaring two variables,
dtStopReport. These two
variables will be used to determine the starting and stopping time of the report. Since the report may take
several seconds to run on large sites, noting the starting and stopping times serve as useful metrics.
Next we create two instances of the Dictionary objects,
will contain the number of files that fall under a particular file extension, and that group's associated
file size, respectively. We then create an instance of the
FileSystemObject, which we'll use
to grab a folder object instance of the Web's root directory.
This is followed by determining whether or not the user wants to recurse the directories. We check to see
if a particular value is in the QueryString. If
the user is interested in recursing the directories; else, the user doesn't want to recurse. Next we
obtain the physical path of the root Web directory using
Server.MapPath. If you are unfamiliar
Server.MapPath, be sure to read Using
Once we have the physical path of the root Web directory, we can use the
GetFolder method of the
FileSystemObject to store the folder information in
Finally we are ready to call
TraverseFolder, passing in the root Web directory (
the two empty dictionary objects (
objSizeDict), and a boolean value
representing if we are interested in having the directories recursed or not (
We end this section of code by setting
dtStopReport to the current time. We're not quite completed
ExamineWeb.asp. We still need to display the results of the report, generate the two bar graphs,
and provide drill down links to the
DetailedReport.asp report! Quite a bit more, eh? We'll finish
ExamineWeb.asp in Part 4.