I want to add a form of access security to a DLL that I created and I was hoping to restrict within the code a check of the calling application's GUID. I cannot seem to find a way to retrieve the calling app's GUID to verify if it has access.
Is this even possible, and if so could someone pr开发者_如何学运维ovide a code snippet on how to determine the GUID?
I found my answer...here is an example in VB:
Dim asm As Assembly = Assembly.GetExecutingAssembly()
Dim attribs = (asm.GetCustomAttributes(GetType(GuidAttribute), True))
MsgBox(DirectCast(attribs(0), GuidAttribute).Value.ToUpper)
This provides the calling application's GUID.
精彩评论