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

본문 바로가기

vb.net

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

회원사진
하나를하더라도최선을
2022-07-09 08:11 4,912 0

본문



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

댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색