VB 获取文件版本

Function GetVer(FilePathName As String) As String
    If FilePathName = Nothing Or FilePathName = "" Then
        FilePathName = App.Path & "\" & App.EXEName & ".exe"
    End If
    
    Dim fso As FileSystemObject
    Set fso = New FileSystemObject
    Dim fver As String, verStr() As String
    If Dir(FilePathName, vbNormal) = "" Then
        GetVer = "Eroor:" & FilePathName & "???"
        Exit Function
    End If
    GetVer = fso.GetFileVersion(FilePathName)
End Function

 

posted @ 2015-09-29 16:22  bobo-bobo  阅读(629)  评论(0编辑  收藏  举报