Set fso=Server.CreateObject("Scripting.FileSystemObject") |
%Set fso=Server.CreateObject("Scripting.FileSystemObject")%> %=fso.GetDriveName("d:")%>br> %=fso.GetDrive("d:")%> |
% Set fso=Server.CreateObject("Scripting.FileSystemObject") Set drv=fso.GetDrive(fso.GetDriveName("d:")) %> 該盤的空間大?。?=drv.TotalSize%>br> 該盤的剩余空間大?。?=drv.FreeSpace%> |
% Function ShowDriveInfo(drvPath) Dim fso, drv, s Set fso = CreateObject("Scripting.FileSystemObject") Set drv = fso.GetDrive(fso.GetDriveName(drvPath)) s = "驅(qū)動盤" drv "的卷標(biāo)是:" s = s drv.VolumeName "br>" s = s "總計空間:" drv.TotalSize "br>" s = s "剩余空間:" drv.FreeSpace "br>" s = s "文件類型:" drv.DriveType "br>" s = s "文件系統(tǒng):" drv.FileSystem Response.Write s End Function %> % on error resume next whatpath=request.form("path") if whatpath>"" then ShowDriveInfo(whatpath) end if%> form action="drvinfo.asp" method="post"> input name="path"> input type="submit"> /form> |
% Function tran(Driver) Select Case Driver Case 0: tran="設(shè)備無法識別" Case 1: tran="軟盤驅(qū)動器" Case 2: tran="硬盤驅(qū)動器" Case 3: tran="網(wǎng)絡(luò)硬盤驅(qū)動器" Case 4: tran="光盤驅(qū)動器" Case 5: tran="RAM虛擬磁盤" End Select End Function set fso=Server.CreateObject("Scripting.FileSystemObject") %> table border=1 width="100%"> tr> td>盤符/td> td>類型/td> td>卷標(biāo)/td> td>總計大小/td> td>可用空間/td> td>文件系統(tǒng)/td> td>序列號/td> td>是否可用/td> td>路徑/td> /tr> % on error resume next For each drv in fso.Drives Response.Write "tr>" Response.Write "td>" drv.DriveLetter "/td>" Response.write "td>" tran(drv.DriveType) "/td>" Response.write "td>" drv.VolumeName "/td>" Response.write "td>" FormatNumber(drv.TotalSize / 1024, 0) "/td>" Response.write "td>" FormatNumber(drv.Availablespace / 1024, 0) "/td>" Response.write "td>" drv.FileSystem "/td>" Response.write "td>" drv.SerialNumber "/td>" Response.write "td>" drv.IsReady "/td>" Response.write "td>" drv.Path "/td>" Response.Write "/tr>" Next set fs=nothing %> /table> |
標(biāo)簽:湖北 朝陽 馬鞍山 遼陽 四平 防城港 孝感 平頂山
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP編程入門進(jìn)階(十六):FSO組件之驅(qū)動器操作》,本文關(guān)鍵詞 ASP,編程,入門,進(jìn)階,十六,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。