I would take it one step forward and create a class:
public class MyVars {
public string MailClass {get;set;}
public string Selectivity {get;set;}
public string MailForeigns {get;set;}
public string ImbType {get;set;}
public string Postnet {get;set;}
}
And initiailize it from the Dictionary in the other answer like this:
var myVars = new MyVars {
MailClass = dict["MailClass"],
Selectivity = dict["Selectivity"],
MailForeign = dict["MailForeigns"],
ImbType = dict["ImbType"],
Postnet = dict["Postnet"]
}
Then, you are dealing with strong type entity that can easily be moved around.
You can then have different types as well, for example you might decide that Postnet is a bool and maybe another int var will come along next week.
public class MyVars {
public string MailClass {get;set;}
public string Selectivity {get;set;}
public string MailForeigns {get;set;}
public string ImbType {get;set;}
public bool Postnet {get;set;}
public int SomeNewVar {get;set;}
}
var myVars = new MyVars {
MailClass = dict["MailClass"],
Selectivity = dict["Selectivity"],
MailForeign = dict["MailForeigns"],
ImbType = dict["ImbType"],
Postnet = dict["Postnet"]=="YES",
SomeNewVar = int.Parse(dict["SomeNewVar"])
}
Dictionary<string, string>is what you are looking for.