How to save my data as a session variable in .NET Windows Forms?

I am using .NET Windows Forms. I need to save a specific date to check the status. Therefore, I have to maintain it until the user logs out.

Like a session in ASP.NET.

How can i do this? (Note that it should not expire until the user logs out.)

Update:

I am creating a namespace like this

nsGlobalData namespace {

class GlobalData p>

{

    public static int GlobalOrgId;

 }

}

Install:

GlobalData.GlobalOrgId = Convert.ToInt16 (ds.Tables [1] .Rows [0] .ItemArray [0]);

Toget

txtnamt.text = GlobalData.GlobalOrgId;

+3
source share
2 answers
class Program
{
    internal static Dictionary<string, object> GlobalVariables = new Dictionary<string, object>();

    static void Main(string[] args)
    {
        ...
    }
}
+2
source

?

+2

Source: https://habr.com/ru/post/1749175/


All Articles