<%
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. 디스크 용량 모니터링
가장 많이 본 글
-
Sqllib 오류: 데이터베이스 %1은(는) 여러 개의 볼륨에 저장되어 있으며, 그 중 일부만 섀도 복사되고 있습니다.
-
금일자 Zdnet 기사에 흥미로운게 하나 올라와 있네요.^^;; 새로운 OS 를 개발하고 있다는 얘기는 본적이 있는데 말이지요.. "Singularity는 차기 윈도우와는 상관이 없다" "OS와 애플리케이션간 정보 교환 방...
-
단순 조회만 하면, 아래 처럼 필요가 없지만, 조회 요청한 데이터가 출력될때까지, 대기를 해야 하고, 데이터를 확인후에만 다음 단계로 넘어가야 할때. 주로 사용. function checkValid (x ) { return new Pr...
댓글 없음:
댓글 쓰기