본문 바로가기
개발자 커뮤니티에 오신 것을 환영합니다!

기타 [vb.net] Assembly GUID 가져오기

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 40,471회 작성일 22-07-09 08:11

본문

Imports System.Runtime.InteropServices
 
Module _ASM_GUID_
    Public Function ASM_GUID() As String
        Dim asm As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly()
        ''The following line (part of the original answer) is misleading.
        ''**Do not** use it unless you want to return the System.Reflection.Assembly type's GUID.
        'getGUID = assembly.[GetType]().GUID.ToString()
 
        '//fea961de-2778-4732-8de0-9689305de95b
        ' The following is the correct code.
        Dim attribute = CType(asm.GetCustomAttributes(GetType(GuidAttribute), True)(0), GuidAttribute)
        Return attribute.Value
    End Function
End Module

댓글목록

등록된 댓글이 없습니다.


Copyright © program1472 | IT HUB. All rights reserved.