当前位置:编程学习 > asp >>

如何读取服务器上的驱动器?

答案: <%
vv=drive()
response.write vv
function drive()
Dim fs, d, dc, s, n
Set fs = CreateObject("Scripting.FileSystemObject")
Set dc = fs.Drives
For Each d in dc
If d.IsReady Then
s = s & d.DriveLetter & " - "
If d.DriveType = 3 Then n = d.ShareName Else n = d.VolumeName
s = s & "当前驱动器:" & n
s = s & "SN: " & d.SerialNumber
s = s & "可用空间: " & FormatNumber(d.AvailableSpace/1024, 0)
s = s & "KB"
End If
Next
response.write s
end function
%>

上一个:asp如何对数组显示和排序?
下一个:如何定义一个数据库的记录集?

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,