用ASP列出服務器上的所有硬盤及分類
發表時間:2024-02-10 來源:明輝站整理相關軟件相關文章人氣:
[摘要]列出服務器的的所有磁盤. <% function Tran(drv) select case drv case 0:Tran="設備無法識別" case 1:Tran="軟盤驅動器" case 2:Tran="硬盤驅動器" case...
列出服務器的的所有磁盤.
<%
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>"
%>
(出處:熱點網絡)