2个回答
展开全部
展开全部
Private Sub Command1_Click()
Dim fs As Object, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
drvPath = "C:\" '自己修改此处
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " (Name: "
s = s & d.VolumeName & ")" & vbCrLf
s = s & "容量:" & FormatNumber(d.TotalSize, 0) & "Bytes" & vbCrLf
s = s & "可用空间:" & FormatNumber(d.freeSpace, 0) & "Bytes" & vbCrLf
s = s & "已用空间:" & FormatNumber(d.TotalSize - d.freeSpace, 0) & "Bytes"
MsgBox s
End Sub
Dim fs As Object, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
drvPath = "C:\" '自己修改此处
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " (Name: "
s = s & d.VolumeName & ")" & vbCrLf
s = s & "容量:" & FormatNumber(d.TotalSize, 0) & "Bytes" & vbCrLf
s = s & "可用空间:" & FormatNumber(d.freeSpace, 0) & "Bytes" & vbCrLf
s = s & "已用空间:" & FormatNumber(d.TotalSize - d.freeSpace, 0) & "Bytes"
MsgBox s
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询