取得指定驱动器的剩余空间容量

代码:

<!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>Free Space in bytes: " & d.FreeSpace

Response.Write(n)

set d=nothing

set fs=nothing

%>

 

</body>

</html>

结果:

Drive: C:
Free Space in bytes: 466982301696

相关文章