you should create a static and public class in a separate file (because of avoiding nested classes) like this
Code:
public static class MyVariables
{
public static string Username {get; set; }
}
and you can set MyVariables.Username = "some username"; and access it like:
string username = MyVariables.Username;