开发者

Determine calling application GUID

开发者 https://www.devze.com 2023-03-28 23:01 出处:网络
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 call

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消