VB中一个关于FSO的问题

2024年11月17日 13:27
有1个网友回答
网友(1):

Private Sub Command1_Click()
Dim fs, f, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("e:\GHOSTV11.EXE") '可以随便换文件路径名,但需要这个文件路径名是存在的。
Set d = fs.getdrive(fs.GetDriveName(f))
s = f.Name & " on Drive " & UCase(f.Drive) & vbCrLf
s = s & "卷标:" & d.volumename & vbCrLf
s = s & "Created: " & f.DateCreated & vbCrLf
s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
s = s & "Last Modified: " & f.DateLastModified
MsgBox s, 0, "File Access Info"
End Sub