public Dictionary <string, string> GetAttributes() { if (!IsDotNetAssembly) { return(null); } var attributeDictionary = new Dictionary <string, string>(); // 获取 IReferenceIdentity 接口. Fusion.IReferenceIdentity referenceIdentity = Fusion.NativeMethods.GetAssemblyIdentityFromFile(ExeFilePath, ref Fusion.NativeMethods.ReferenceIdentityGuid) as Fusion.IReferenceIdentity; var enumAttributes = referenceIdentity.EnumAttributes(); Fusion.IDENTITY_ATTRIBUTE[] IDENTITY_ATTRIBUTEs = new Fusion.IDENTITY_ATTRIBUTE[1024]; enumAttributes.Next(1024, IDENTITY_ATTRIBUTEs); foreach (var IDENTITY_ATTRIBUTE in IDENTITY_ATTRIBUTEs) { if (!string.IsNullOrEmpty(IDENTITY_ATTRIBUTE.Name)) { attributeDictionary.Add(IDENTITY_ATTRIBUTE.Name, IDENTITY_ATTRIBUTE.Value); } } return(attributeDictionary); }
public Dictionary<string, string> GetAttributes() { if (!IsDotNetAssembly) { return null; } var attributeDictionary = new Dictionary<string, string>(); // 获取 IReferenceIdentity 接口. Fusion.IReferenceIdentity referenceIdentity = Fusion.NativeMethods.GetAssemblyIdentityFromFile(ExeFilePath, ref Fusion.NativeMethods.ReferenceIdentityGuid) as Fusion.IReferenceIdentity; var enumAttributes = referenceIdentity.EnumAttributes(); Fusion.IDENTITY_ATTRIBUTE[] IDENTITY_ATTRIBUTEs=new Fusion.IDENTITY_ATTRIBUTE[1024]; enumAttributes.Next(1024, IDENTITY_ATTRIBUTEs); foreach (var IDENTITY_ATTRIBUTE in IDENTITY_ATTRIBUTEs) { if (!string.IsNullOrEmpty(IDENTITY_ATTRIBUTE.Name)) { attributeDictionary.Add(IDENTITY_ATTRIBUTE.Name, IDENTITY_ATTRIBUTE.Value); } } return attributeDictionary; }