G Guest Feb 25, 2005 #2 I have this code which works but it seems like a lot of effort to get some text values. Is this the correct way? Assembly thisAsm = this.GetType().Assembly; object[] attrs = thisAsm.GetCustomAttributes(typeof(AssemblyTitleAttribute), false); string test1 = ((AssemblyTitleAttribute)attrs[0]).Title; object[] attrs1 = thisAsm.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); string test2 = ((AssemblyCompanyAttribute)attrs1[0]).Company;
I have this code which works but it seems like a lot of effort to get some text values. Is this the correct way? Assembly thisAsm = this.GetType().Assembly; object[] attrs = thisAsm.GetCustomAttributes(typeof(AssemblyTitleAttribute), false); string test1 = ((AssemblyTitleAttribute)attrs[0]).Title; object[] attrs1 = thisAsm.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); string test2 = ((AssemblyCompanyAttribute)attrs1[0]).Company;