// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Reflection; public class Info { public static string GetVersion() { Assembly asm = Assembly.GetCallingAssembly(); object[] attrs = asm.GetCustomAttributes(false); for(int i = 0; i < attrs.Length; i++) { if(attrs[i] is AssemblyConfigurationAttribute) { AssemblyConfigurationAttribute cfg = (AssemblyConfigurationAttribute)attrs[i]; return cfg.Configuration; } } return ""; } }