vb获取硬件信息的代码 10
tmpstr=""
set fso=createObject("scripting.filesystemObject")
Set dc = fso.Drives
for each d in dc
If d.isReady Then
tmpstr=tmpstr & "磁盘" & d.DriveLetter & ":" & vbcrlf &_
"可用空间:" & (d.AvailableSpace/1024/1024/1024) & " GB" & vbcrlf &_
"空余空间:" & (d.FreeSpace/1024/1024/1024) & " GB" &vbcrlf &_
"总空间大小:" & (d.TotalSize/1024/1024/1024) & " GB" &vbcrlf &_
"文件系统:" & d.FileSystem & vbcrlf &_
"驱动器类型:" & d.DriveType &vbcrlf &_
"是否就绪:" & d.IsReady &vbcrlf &_
"路径:" & d.Path &vbcrlf &_
"根目录:" & d.RootFolder &vbcrlf &_
"序列号:" & d.SerialNumber &vbcrlf &_
"共享名:" & d.ShareName &vbcrlf &_
"卷名:" & d.VolumeName &vbcrlf &vbcrlf
End If
Next
msgbox tmpstr
2024-12-11 广告