深圳升蓝软件
数据库开发 .Net技术  |  ASP技术 PHP技术 JSP技术 应用技术类   
Hiblue Software

用ASP列出服务器上的所有硬盘及类型


March 25,2004
  列出服务器的的所有磁盘.
<%
function Tran(drv)
  select case drv
      case 0:Tran="设备无法识别"
      case 1:Tran="软盘驱动器"
      case 2:Tran="硬盘驱动器"
      case 3:Tran="网络硬盘驱动器"
      case 4:Tran="光盘驱动器"
      case 5:Tran="RAM虚拟驱动器"
  end select
end function

Set fs=Server.CreateObject("Scripting.FileSystemObject")
response.write "<table width='100%' cellpadding='5' cellspacing='2'><tr><td><b>盘符</td><td><b>驱动器类型
</td></tr>"
for each d in fs.drives
  response.write "<tr><td><a href=files.asp?sPath=" & d.DriveLetter & ":><font size=4><b>" &
d.DriveLetter & "</a></td><td><font size=4><b>" & Tran(d.DriveType) & "</tr>"
next
set fs=nothing
response.write "</table>"
%>
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved