<%
Set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives
For Each DiskDrive in Drives
If DiskDrive.IsReady Then
totalspace = DiskDrive.TotalSize
freespace = DiskDrive.FreeSpace
usedspace = totalspace - freespace
freepercent = Int((freespace/totalspace)*100)
freemb = Int((freespace/1024)/1024)
usedmb = Int((usedspace/1024)/1024)
usedpercent = Int((usedspace/totalspace)*100)
If freespace =< 1048576 Then
freelabel = FormatNumber(freespace/1024, 1) & " Kb"
Elseif freespace =< 1073741824 then
freelabel = FormatNumber((freespace/1024)/1024, 1) & " Mb"
Else
freelabel = FormatNumber(((freespace/1024)/1024)/1024, 2) & " Gb"
End If
If usedspace =< 1048576 Then
usedlabel = FormatNumber(usedspace/1024, 1) & " Kb"
Elseif usedspace =< 1073741824 Then
usedlabel = FormatNumber((usedspace/1024)/1024, 1) & " Mb"
Else
usedlabel = FormatNumber(((usedspace/1024)/1024)/1024, 2) & " Gb"
End If
If Left(freelabel,3) = "0.0" Then freelabel = "0 bytes"
If Left(usedlabel,3) = "0.0" Then usedlabel = "0 bytes"
used_alt_tag = "Drive " & DiskDrive.DriveLetter & ": " & usedlabel & " in use"
free_alt_tag = "Drive " & DiskDrive.DriveLetter & ": " & freelabel & " free"
Response.Write "Drive " & DiskDrive.DriveLetter & ": "
If DiskDrive.VolumeName <> "" then
Response.Write "[" & DiskDrive.VolumeName & "] : "
End If
Response.Write "<br>"
End If
Next
Set Drives = nothing
Set FileSystemObject = nothing
%>
위와 같은 디스크정보는 WMI를 통해서도 가능하다.
http://www.serverinfo.pe.kr/TipnTech.aspx?Content=Windows&Search=&vMode=View&page=&Seq=141
출처 : http://www.brettb.com/ASPDiskMonitoringScript.asp
2005/12/18
Asp. 디스크 용량 모니터링
가장 많이 본 글
-
닷넷 프레임워크 2 에서 부터 제공하는 GZipStream 압축 클래스 using System.IO; using System.IO.Compression; FileStream fs = new FileStream("c:\\wsspl...
-
Windows Server 2008 Service Pack 2 Beta 버젼이, 주요국 언외에 한국어등 몇개 언어가 추가로 배포되고 있는 중입니다. 아시다 시피??,. Windows Server 2008 / Vista 부터는 Service Pack 를...
-
다음 목록은,. 정보호호진흥원에서 정리해서 배포하는 보안관련 점검 도구 및 자료입니다. 이 내용은,. KIDC 에 있는 서버들이 해당되는 경우 IDC 에서 고객사에 통보해 주는 메일 내용중 일부인데요. 뭐 유용한? 내용이라 올려 봅니다.^^ <...
댓글 없음:
댓글 쓰기