RSS订阅优然探索
你的位置:首页 » 技术笔记 » 正文

vb.net取得Assembly(取得软件版本信息的功能)

选择字号: 超大 标准 发布时间:2008-9-11 10:36:24 | 作者:admin | 0个评论 | 人浏览

#Region "取得软件版本信息的功能"
    '#################################################################################
    '1 Version:2008.3.1.0
    '2 Title:0451sky 教务管理系统(悠索科技工作室)
    '3 Description:最后修改时间:2008-8-16后台顶部;2008-7-25(需要授权文件才能正常的使用全部的功能3ec4953bef5326049c1a23104902787e)
    '4 Company:悠索科技工作室开发制作-正式版本软件
    '5 Product:教师教学质量评价系统/学生成绩管理系统
    '6 Copyright:悠索科技工作室
    '7 Trademark:CopyRight By 0451sky http://www.0451sky.com
    '#################################################################################
    Public Function GetCustomAssembly() As String(,)
        Dim AInfo(7, 2) As String
        Dim Ass As [Assembly]
        Ass = [Assembly].GetExecutingAssembly()
        Dim attr As Attribute
        Dim RetStr, br As String
        br = "<br>"
        Dim Version As Version
        Dim AssemblyName As AssemblyName
        AssemblyName = Ass.GetName
        Version = AssemblyName.Version
        ' RetStr += "Version=" + Version.ToString + br

        AInfo(1, 1) = "Version"
        AInfo(1, 2) = Version.ToString

        Dim AssA As Attribute
        Dim I As Integer
        I = 0
        For Each attr In Attribute.GetCustomAttributes(Ass)
            I += 1
            If TypeOf attr Is AssemblyTitleAttribute Then
                Dim A As AssemblyTitleAttribute = CType(attr, AssemblyTitleAttribute)

                AInfo(2, 1) = "Title"
                AInfo(2, 2) = A.Title.ToString
            ElseIf TypeOf attr Is AssemblyDescriptionAttribute Then
                Dim A As AssemblyDescriptionAttribute = CType(attr, AssemblyDescriptionAttribute)

                AInfo(3, 1) = "Description"
                AInfo(3, 2) = A.Description.ToString
            ElseIf TypeOf attr Is AssemblyCompanyAttribute Then
                Dim A As AssemblyCompanyAttribute = CType(attr, AssemblyCompanyAttribute)

                AInfo(4, 1) = "Company"
                AInfo(4, 2) = A.Company.ToString

            ElseIf TypeOf attr Is AssemblyProductAttribute Then
                Dim A As AssemblyProductAttribute = CType(attr, AssemblyProductAttribute)

                AInfo(5, 1) = "Product"
                AInfo(5, 2) = A.Product.ToString
            ElseIf TypeOf attr Is AssemblyCopyrightAttribute Then
                Dim A As AssemblyCopyrightAttribute = CType(attr, AssemblyCopyrightAttribute)
                AInfo(6, 1) = "Copyright"
                AInfo(6, 2) = A.Copyright.ToString
            ElseIf TypeOf attr Is AssemblyTrademarkAttribute Then
                Dim A As AssemblyTrademarkAttribute = CType(attr, AssemblyTrademarkAttribute)

                AInfo(7, 1) = "Trademark"
                AInfo(7, 2) = A.Trademark.ToString
            End If
        Next
        GetCustomAssembly = AInfo
    End Function
#End Region

标签:Assembly  

猜你喜欢

发表评论

必填

选填

选填

必填,不填不让过哦,嘻嘻。

记住我,下次回复时不用重新输入个人信息

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。