[英]How can I retrieve the Strong Key of a assembly
How do I retrieve the Strong Key of an assembly using C#? 如何使用C#检索程序集的Strong Key? Is there a method that will work for .Net and non-.Net assemblies. 是否有一种适用于.Net和非.Net程序集的方法。 I've just received a request to uniquely identify assemblies across a number of systems. 我刚刚收到了在多个系统中唯一标识程序集的请求。
我假设您要检索已签名程序集的公钥令牌,请检查以下链接
I think this is what you're looking for 我认为这就是您要寻找的
var key = assembly.GetName().GetPublicKey();
var keyToken = assembly.GetName().GetPublicKeyToken();
If you need as string try this 如果您需要作为字符串尝试此
var keyTokenString = string.Join("", assembly.GetName().GetPublicKeyToken().Select(x => x.ToString("x2")));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.