ASP编程教程技巧综合大全(41)
2015-8-25编辑:ljnbset
下面的代码说明在 JScript 中实现同样的功能:
function ShowDriveInfo1(drvPath)
{
var fso, drv, s ="";
fso = new ActiveXObject("Scripting.FileSystemObject");
drv = fso.GetDrive(fso.GetDriveName(drvPath));
s += "Drive " + drvPath.toUpperCase()+ " - ";
s += drv.VolumeName + "
";
s += "Total Space: " + drv.TotalSize / 1024;
s += " Kb" + "
";
s += "Free Space: " + drv.FreeSpace / 1024;
s += " Kb" + "
";
Response.Write(s);
}
function ShowDriveInfo1(drvPath)
{
var fso, drv, s ="";
fso = new ActiveXObject("Scripting.FileSystemObject");
drv = fso.GetDrive(fso.GetDriveName(drvPath));
s += "Drive " + drvPath.toUpperCase()+ " - ";
s += drv.VolumeName + "
";
s += "Total Space: " + drv.TotalSize / 1024;
s += " Kb" + "
";
s += "Free Space: " + drv.FreeSpace / 1024;
s += " Kb" + "
";
Response.Write(s);
}