-----056-FileSystemObject.html-----
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 5 <title>标题</title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 fso = new ActiveXObject("Scripting.FileSystemObject"); 10 document.write("<ol><li>" + fso.getDrive(fso.getDriveName("c://///")).Path); 11 document.write("<li>" + fso.getDrive(fso.getDriveName("d:")).Path); 12 document.write("<li>" + fso.getDrive(fso.getDriveName("e:/")).Path); 13 document.write("<li>" + fso.getDrive(fso.getDriveName("f:\\jjj000")).Path); 14 document.write("<li>" + fso.getDrive(fso.getDriveName("r:\\\\\\\\")).Path + "</ol><br/>"); 15 s = "<ol>"; 16 for(drive=new Enumerator(new ActiveXObject("Scripting.FileSystemObject").Drives); !drive.atEnd(); drive.moveNext()) 17 { 18 s += "<li>驱动器号:" + drive.item().DriveLetter + "<br/>"; 19 s += "驱动器卷标:" + drive.item().VolumeName + "<br/>"; 20 s += "驱动器类型:" + drive.item().DriveType + "<br/>"; 21 s += "驱动器文件系统:" + drive.item().FileSystem + "<br/>"; 22 s += "驱动器就绪状态:" + drive.item().IsReady + "<br/>"; 23 s += "驱动器路径:" + drive.item().Path + "<br/>"; 24 s += "驱动器根文件夹:" + drive.item().RootFolder + "<br/>"; 25 s += "驱动器序列号:" + drive.item().SerialNumber + "<br/>"; 26 s += "驱动器共享名:" + drive.item().ShareName + "<br/>"; 27 s += "驱动器总容量:" + drive.item().TotalSize/1073741824 + " GB<br/>"; 28 s += "驱动器可用空间:" + drive.item().AvailableSpace/1073741824 + " GB<br/>"; 29 s += "驱动器空闲空间:" + drive.item().FreeSpace/1073741824 + " GB<br/><br/>"; 30 } 31 document.write(s); 32 function sp(n) 33 { 34 var s = ""; 35 for(var i=0; i<n; i++) 36 { 37 s += " "; 38 } 39 return s; 40 } 41 </script> 42 </body> 43 </html>
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 5 <title>标题</title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 fso = new ActiveXObject("Scripting.FileSystemObject"); 10 document.write("<ol><li>" + fso.getDrive(fso.getDriveName("c://///")).Path); 11 document.write("<li>" + fso.getDrive(fso.getDriveName("d:")).Path); 12 document.write("<li>" + fso.getDrive(fso.getDriveName("e:/")).Path); 13 document.write("<li>" + fso.getDrive(fso.getDriveName("f:\\jjj000")).Path); 14 document.write("<li>" + fso.getDrive(fso.getDriveName("r:\\\\\\\\")).Path + "</ol><br/>"); 15 s = "<ol>"; 16 for(drive=new Enumerator(new ActiveXObject("Scripting.FileSystemObject").Drives); !drive.atEnd(); drive.moveNext()) 17 { 18 s += "<li>驱动器号:" + drive.item().DriveLetter + "<br/>"; 19 s += "驱动器卷标:" + drive.item().VolumeName + "<br/>"; 20 s += "驱动器类型:" + drive.item().DriveType + "<br/>"; 21 s += "驱动器文件系统:" + drive.item().FileSystem + "<br/>"; 22 s += "驱动器就绪状态:" + drive.item().IsReady + "<br/>"; 23 s += "驱动器路径:" + drive.item().Path + "<br/>"; 24 s += "驱动器根文件夹:" + drive.item().RootFolder + "<br/>"; 25 s += "驱动器序列号:" + drive.item().SerialNumber + "<br/>"; 26 s += "驱动器共享名:" + drive.item().ShareName + "<br/>"; 27 s += "驱动器总容量:" + drive.item().TotalSize/1073741824 + " GB<br/>"; 28 s += "驱动器可用空间:" + drive.item().AvailableSpace/1073741824 + " GB<br/>"; 29 s += "驱动器空闲空间:" + drive.item().FreeSpace/1073741824 + " GB<br/><br/>"; 30 } 31 document.write(s); 32 function sp(n) 33 { 34 var s = ""; 35 for(var i=0; i<n; i++) 36 { 37 s += " "; 38 } 39 return s; 40 } 41 </script> 42 </body> 43 </html>