Reputation: 11302
I am using .NET Windows Forms. I need to maintain some date to check the condition. So I have to maintain it until the user logs out.
Like session in ASP.NET.
How can I do this? (Note it should not expire until the user logs out.)
I create Namespace like this
namespace nsGlobalData {
class GlobalData
{ public static int GlobalOrgId; }
}
To Set:
GlobalData.GlobalOrgId = Convert.ToInt16(ds.Tables[1].Rows[0].ItemArray[0]);
ToGet
txtnamt.text=GlobalData.GlobalOrgId;
Upvotes: 3
Views: 4518
Reputation: 100308
class Program
{
internal static Dictionary<string, object> GlobalVariables = new Dictionary<string, object>();
static void Main(string[] args)
{
...
}
}
Upvotes: 2