Along the lines of what the others have said about the global static class, but with some sample code :
public class UserInfo
{
private int userID;
public int UserID
{
get { return userID; }
}
private string userName;
public string UserName
{
get { return userName; }
}
public UserInfo(int userID, string userName)
{
this.userID = userID;
this.userName = userName;
}
}
public static class GlobalInfo
{
private static UserInfo currentUser;
public static UserInfo CurrentUser
{
get { return currentUser; }
set { currentUser = value; }
}
}
So, after the user has logged in, save the logged in info :
GlobalInfo.CurrentUser = new UserInfo(123, "Bob Jones");
When you need to fetch info :
UserInfo userInfo = GlobalInfo.CurrentUser;