...Technology Simplified

Monday, November 17, 2014

Accessing a variable using a string containing the variable's name

No comments :
 public class MsgCodes
    {
       public string GetString(string errorCode)
       {
           return (string)this.GetType().GetField(errCode).GetValue(this);
       }
       public const string strError= "No error -just display this text";

No comments :

Post a Comment