Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog
[prev. Lesson]  File Objects: Display Directory as Links/Graphics
     [next Lesson]  Graphic Size Detector

FileObjects Part 3 by Steven Harper
Steven Harper@ScapaSMD.com, Internet Developer

The file object can be used to examine the disk as well as this script submitted by a site viewer, demonstrates.

   filename=/learn/test/fileobjectsinfo.asp

<Test Script Below>


<html><head>
<title>fileobjectsinfo.asp</title>
</head><body>
<%
  disktoexamine="C:"

  set fs = Server.CreateObject("Scripting.FileSystemObject")
  set f = fs.GetDrive(disktoexamine)

  Response.Write("  Root Folder : ")
  Response.Write(f.RootFolder)
  Response.Write("<BR>")
  Response.Write("  Type of Drive :  ")
  if f.DriveType=2 then
    Response.Write("Fixed")
  end if
  if f.DriveType=1 then
    Response.Write("Removable")
  end if
  Response.Write("<BR>")
  Response.Write("  File System : ")
  Response.Write(f.FileSystem)
  Response.Write("<BR>")
  Response.Write("  Total Size on Server's C: &nbsp;&nbsp;")
  Response.Write(f.TotalSize)
  Response.Write("<BR>")
  Response.Write("  Drive Space on Server's C: ")
  Response.Write(f.freespace)
  Response.Write("<BR>")
  Response.Write("  Serial Number : ")
  Response.Write(f.SerialNumber)

  set f=nothing
  set fs=nothing

%>
</body></html>

There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too. a $5 tip buys him lunch at McDonalds, a $20 tip buys his kid Hitoshi a new computer game, a $39 tip buys his daughter Michiko a few nice outfits. See our donor list.