2016-07-27 132 views
0

我想从assemblyInfo.cs文件中读取版权和其他属性。 问题是,我在网上找不到任何东西。c#WPF获取assemblyInfo.cs数据

我的AssemblyInfo.cs文件:

[assembly: AssemblyCopyright("Copyright ©Pascal Hurni 2016")] 
[assembly: AssemblyCompany("Crypto AG")] 

现在我想从其他窗口一样得到这些数据:

string copyright = Something 
+0

好了,有你尝试使用'Assembly.GetCustomAttributes()'? –

+0

问题是,我的intellisense中没有'Assembly.Something' – BlueRedONe

+0

那么你需要在* Assembly上调用它*,是的。通常最容易的方法是使用'typeof(SomeTypeInYourAssembly).Assembly' –

回答

1

使用Assembly.GetCustomAttributes()它在System.Reflection

+0

非常感谢你这工作:) – BlueRedONe