728x90
반응형
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
반응형
댓글