ASP Instance Tutorials: drive objects

Source: Internet
Author: User
Tags object file system
Gets the number of free space for the specified drive: This example shows how to first create a FileSystemObject object and then use the AvailableSpace property to get the free space for the specified drive.

Gets the number of free space for the specified drive: This example shows how to first create a FileSystemObject object and then use the AvailableSpace property to get the free space for the specified drive. Gets the remaining space capacity of the specified drive: This example shows how to use the FreeSpace space property to get the remaining space for the specified drive. Gets the total capacity of the specified drive: this example


Drive objects
Note: The tutorial for this example is related to the drive in the specific space, so run the results to test yourself and no longer provide the running results.

Gets the number of free space for the specified drive

This example shows how to first create a FileSystemObject object and then use the AvailableSpace property to get the free space for the specified drive.

This example code is as follows:

<body>
<%
Dim FS, D, n
Set fs=server.createobject ("Scripting.FileSystemObject")
Set D=fs. Getdrive ("C:")
n = "drive:" & D
n = n & <br> free space in bytes: & d.availablespace
Response.Write (N)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the remaining space capacity of the specified drive

This example shows how to use the FreeSpace space property to get the remaining space for the specified drive.

This example code is as follows:

<body>
<%
Dim FS, D, n
Set fs=server.createobject ("Scripting.FileSystemObject")
Set D=fs. Getdrive ("C:")
n = "drive:" & D
n = n & "<br/> Remaining space in bytes:" & D.freespace
Response.Write (N)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the total capacity of the specified drive

This example shows how to use the TotalSize property to get the total capacity of the specified drive.

This article is the Web Teaching (http://www.webjx.com) collection collation or original content, reprint please specify the source!

This example code is as follows:

<body>
<%
Dim Fs,d,n
Set fs=server.createobject ("Scripting.FileSystemObject")
Set D=fs. Getdrive ("C:")
n = "drive:" & D
n = N & "<br> Total capacity in bytes:" & d.totalsize
Response.Write (N)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the letter of the drive for the specified drive

This example shows how to use the DriveLetter property to obtain the drive letter for the specified drive.

This example code is as follows:

<body>
<%
Dim fs, D, n
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
Response.Write ("Drive letter is:" & D.driveletter)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the drive type of the specified drive

This example shows how to use the DriveType property to obtain the drive type of the specified drive.

This example code is as follows:

<body>
<%
Dim fs, D, n
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
Response.Write ("Drive type is:" & D.drivetype)
Set d=nothing
Set fs=nothing
%>
</body>

Get file system information for the specified drive

This example shows how to use filesystem to get the file system type of the specified drive.

This article by the Web page Teaching network (http://www.webjx.com) to organize the release! Reprint please indicate the source, thank you!

This example code is as follows:

<body>
<%
Dim fs, D, n
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
Response.Write ("File system is:" & D.filesystem)
Set d=nothing
Set fs=nothing
%>
</body>

is the drive ready?

This example shows how to use the IsReady property to check whether the specified drive is ready.

This example code is as follows:

<body>
<%
Dim fs,d,n
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
n = "This" & D.driveletter
If D.isready=true Then
n = n & "drive is ready. "
Else
n = n & "drive is not ready. "
End If
Response.Write (N)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the path to the specified drive

This example shows how to use the Path property to get the paths of the specified drive.

This example code is as follows:

<body>
<%
Dim fs,d
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
Response.Write ("Path is:" & D.path)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the root folder of the specified drive

This example shows how to use the RootFolder property to get the root folder of the specified drive.

This example code is as follows:

<body>
<%
Dim fs,d
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
Response.Write ("Root file is:" & D.rootfolder)
Set d=nothing
Set fs=nothing
%>
</body>

Gets the serial number of the specified drive

This example shows how to use the SerialNumber property to get the serial number of the specified drive.

This article is published by the Web Teaching Network (www.webjx.com)! Reproduced and collected words please do not remove! Thank you.

This example code is as follows:

<body>
<%
Dim fs,d
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set D=FS. Getdrive ("C:")
Response.Write ("Serial number:" & D.serialnumber)
Set d=nothing
Set fs=nothing
%>
</body>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.