国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTA > 正文

hta查看磁盤空間的腳本

2020-01-31 15:42:52
字體:
供稿:網(wǎng)友
<html>
<head>
<title>磁盤空間查看腳本</title>
<hta:application
     applicationname="磁盤空間查看腳"     
     border="dialog"
     borderstyle="normal"
     caption="yes"
     contextmenu="no"
     maximizebutton="no"
     minimizebutton="yes"
     navigable="no"
     scroll="yes"
     selection="no"
     showintaskbar="yes"
     singleinstance="yes"
     sysmenu="yes"
     version="1.0"
     windowstate="normal"
>


<script language="vbscript">
<!-- Insert code, subroutines, and functions here -->
window.resizeTo 500, 420
     ileft=(window.screen.width-500)/2
     itop=(window.screen.height-420)/2         
     window.moveTo ileft,itop                             

Sub Window_onLoad 
     GetDiskSpace 
End Sub


Sub GetDiskSpace
Const HARD_DISK = 3
Const Size = 1048576


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate}!//" & strComputer & "/root/cimv2")
Set colDisks = objWMIService.ExecQuery _
     ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")
     strHTML = "<table align=center width=95% borderColor=#698cc2 border='1' cellSpacing='0' cellpadding='1'>"         
                     strHTML = strHTML & "<tr>"
             strHTML = strHTML & "<td width=110px align=center><font size=2><b>" & "分區(qū)" & "</b></td>"
             strHTML = strHTML & "<td width=110px align=center><font size=2><b>" & "容量" & "</b></td>"
             strHTML = strHTML & "<td width=110px align=center><font size=2><b>" & "已用" & "</b></td>"
             strHTML = strHTML & "<td width=110px align=center><font size=2><b>" & "未用" & "</b></td>"
             strHTML = strHTML & "<td width=110px align=center><font size=2><b>" & "空閑" & "</b></td>"

     
For Each objDisk In colDisks     
intFreeSpace = objDisk.FreeSpace/Size
intTotalSpace = objDisk.Size/Size
pctFreeSpace = intFreeSpace/Size/ intTotalSpace/Size
infFuLin = intTotalSpace-intFreeSpace
DeviceID = objDisk.DeviceID
             strHTML = strHTML & "<tr>"
             strHTML = strHTML & "<td width=110px align=center>" & DeviceID & "</td>"
             strHTML = strHTML & "<td width=110px align=right>" & FormatNumber(intTotalSpace,2,-1,-1,0) & "</td>"
             strHTML = strHTML & "<td width=110px align=right><font color=#DB2C00>" & FormatNumber(infFuLin,2,-1,-1,0) & "</td>"
             strHTML = strHTML & "<td width=110px align=right><font color=#008080>" & FormatNumber(intFreeSpace,2,-1,-1,0) & "</td>"
             strHTML = strHTML & "<td width=110px align=right>" & FormatPercent(intFreeSpace/intTotalSpace) & "</td>"

Next
strHTML = strHTML & "</table>"
DataArea.InnerHTML = strHTML
End Sub


</script>
</head>


<body>
<!-- HTML goes here -->
<table align=center width=95%><font color="#C63358"><b>磁盤空間查看腳本</b></font><br>
     <font size="2">顯示各磁盤分區(qū)使用情況(<font color="#FF0000">/MB</font>)</font></font></table>
<body bgcolor="#99CCFF">
     <span id = "DataArea"></span>
</body>
</html> 
保存為hta文件.

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 育儿| 丹凤县| 仙桃市| 阳春市| 大关县| 黄平县| 巫山县| 海宁市| 弥渡县| 天台县| 麟游县| 红桥区| 克山县| 大荔县| 神池县| 航空| 石泉县| 汝州市| 招远市| 高州市| 文安县| 阿鲁科尔沁旗| 宝应县| 海淀区| 河曲县| 鱼台县| 平凉市| 琼海市| 曲麻莱县| 新泰市| 南木林县| 徐州市| 玉山县| 依兰县| 定州市| 惠州市| 会理县| 庆元县| 丰县| 海盐县| 双鸭山市|