取得指定驱动器的总容量

代码:

<!DOCTYPE html>

<html>

<body>

 

<%

Dim fs,d,n

Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set d=fs.GetDrive("c:")

n = "Drive: " & d

n = n & "<br>Total size in bytes: " & d.TotalSize

Response.Write(n)

set d=nothing

set fs=nothing

%>

 

</body>

</html>

结果:

Drive: C:
Total size in bytes: 598876352512

相关文章