public MainWindow()
        {
            InitializeComponent();
            if (File.Exists(filem))
            {
                StreamReader   file  = File.OpenText(filem);
                JsonSerializer jsSer = new JsonSerializer();
                datanum        dm    = (datanum)jsSer.Deserialize(file, typeof(datanum));
                username.Text     = dm.usernamecs;
                password.Password = dm.passwordcs;

                detect = true;
            }
        }
 private void SignIn(object sender, RoutedEventArgs e)
 {
     if (detect == true)
     {
         datanum dn = new datanum();
         AppMain ap = new AppMain();
         dn.usernamecs = username.Text;
         dn.passwordcs = password.Password.ToString();
         this.Close();
         ap.DataReceive(dn.usernamecs, dn.passwordcs);
     }
     else
     {
         datanum dn = new datanum();
         dn.usernamecs = username.Text;
         dn.passwordcs = password.Password.ToString();
         AppMain ap = new AppMain();
         this.Close();
         ap.DataReceive(dn.usernamecs, dn.passwordcs);
         string output = JsonConvert.SerializeObject(dn, Formatting.Indented);
         Console.WriteLine(output);
         System.IO.File.WriteAllText(filem, output);
     }
 }