View Source
Go Back to /jang/books/asp/example/fileAccess/diskSpace01.asp
<%@language=JScript%>
<%  title="ÀˬdµwºÐ©Ò³ÑªÅ¶¡" %>
<!--#include file="../head.inc"-->
<hr>

<%
function showFreeSpace(drivePath){
      var fso, d, out;
      fso = new ActiveXObject("Scripting.FileSystemObject");
      d = fso.GetDrive(fso.GetDriveName(drivePath));
      out = d.VolumeName + " (" + drivePath + ") ";
      out = out + " ===> Free Space: " + d.FreeSpace/1024/1024 + " MB<br>";
      return(out);
}
%>


<%Response.write(showFreeSpace("c:"))%>
<%Response.write(showFreeSpace("d:"))%>

<hr>
<!--#include file="../foot.inc"-->