View Source
Go Back to /jang/books/asp/example/fileAccess/diskSpace02.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(drivePath);
      out = d.VolumeName + " (" + drivePath + ") ";
      out = out + " ===> Free Space: " + d.FreeSpace/1024/1024 + " MB<br>";
      return(out);
}
%>


<%
fso = new ActiveXObject("Scripting.FileSystemObject");
Response.write(fso.GetDriveName("c:")+"<br>");
d=fso.GetDrive("c:");
Response.write(d.VolumeName+"<br>");
%>

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

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