![]() |
WebCheatSheet.com |
![]() |
ASP Drive Object |
The Drive object represents a physical drive. This drive can exist on your machine, or it can be a drive shared by another machine. To work with the Drive object's properties, you need to create an instance of the FileSystemObject object first and then instantiate the Drive object through the GetDrive method or the Drives property of the FileSystemObject object. The Drive object properties are as follows: Properties
How to use the ASP Drive Object In the following example we create an instance of the FileSystemObject object and then use the GetDrive method to instantiate the Drive object. After that we use The Drive object properties to get the information about the specified drive (c:): <% Dim objFSO, objDrive 'Create a FileSystemObject instance Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 'Using the GetDrive method of FileSystemObject object, initialize a Drive object Set objDrive = objFSO.GetDrive("C:") 'Retrieve information about the drive Response.Write "FileSystem: " & objDrive.FileSystem & "<br />" Response.Write "SerialNumber: " & objDrive.SerialNumber & "<br />" Response.Write "VolumeName: " & objDrive.VolumeName & "<br />" Response.Write "AvailableSpace: " & objDrive.AvailableSpace & " bytes<br />" Response.Write "FreeSpace: " & objDrive.FreeSpace & " bytes <br/>" Response.Write "TotalSize: " & objDrive.TotalSize & " bytes" %> |
![]() |
![]() |
Copyright © 2005-2007 www.WebCheatSheet.com All Rights Reserved. |