搜索文章:

首页  |  Java技术  |  Asp.net  |  Asp编程  |  VC/C++  |  Delphi  |  VB编程

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

作者: unknow
列出服务器的的所有磁盘.
<%
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>"
%>
相关文章:
© 2006   www.java-asp.net