如果只是查看大小、修改时间的话,可以直接使用VB内建函数: 返回文件修改时间:FileDateTime(文件路径) 返回文件字节大小:FileLen(文件路径) 示例: Private Sub Form_Load() Dim sOut As String Const sFile As String = "C:/WINDOWS/notepad.exe" sOut = "文件路径: " & sFile & vbCrLf & _ "修改日期: " & FileDateTime(sFile) & vbCrLf & _ "文件大小: " & FileLen(sFile) & "字节" MsgBox sOut End Sub 如果要更多属性,则需要用到FSO。只有运行时确定用户的机器上有且没有禁用“Microsoft Scripting Runtime”。 工程=>引用,钩选“Microsoft Scripting Runtime”,确定。 示例: Private Sub Form_Load() Dim sOut As String Const sFile As String = "C:/WINDOWS/notepad.exe" sOut = "文件路径: " & sFile & vbCrLf & _ "创建日期: " & GetFileAttr(sFile,0) & vbCrLf & _ "修改日期: " & GetFileAttr(sFile,1) & vbCrLf & _ "访问日期: " & GetFileAttr(sFile,2) & vbCrLf & _ "文件大小: " & GetFileAttr(sFile,3) & "字节" & vbCrLf & _ "文件类型: " & GetFileAttr(sFile,4) MsgBox sOut End Sub Private Function GetFileAttr(sPath As String,iAttr As Integer) Dim oFSO As New FileSystemObject Dim oFile As File Dim sOut As String Set oFile = oFSO.GetFile(sPath) Select Case iAttr Case 0 '创建日期 sOut = oFile.DateCreated Case 1 '修改日期 sOut = oFile.DateLastModified Case 2 '访问日期 sOut = oFile.DateLastAccessed Case 3 '文件大小 sOut = oFile.Size Case 4 '文件类型 sOut = oFile.Type End Select GetFileAttr = sOut End Function