int getValue(string wl) { FieldInfo fi=this.GetType().GetField("a"+wl ,BindingFlags.NonPublic|BindingFlags.Instance ); if(fi==null) throw(new Exception("cant find a"+wl)); if(fi.FieldType!=typeof(int)) throw(new Exception("type unmatched")); return (int)fi.GetValue(this); }