private void CheckRemember(Window p) { if (!File.Exists("Pass.txt")) { FileStream fs; fs = new FileStream("Pass.txt", FileMode.Create); StreamWriter sWriter = new StreamWriter(fs, Encoding.UTF8); sWriter.WriteLine("Hello World!"); sWriter.Flush(); fs.Close(); } string[] lines = File.ReadAllLines("Pass.txt"); if (lines[lines.Length - 1] == "1") { Tendangnhap = MyStaticMethods.Base64Decode(lines[lines.Length - 3]); Matkhau = MyStaticMethods.Base64Decode(lines[lines.Length - 2]); CheckedRemember = true; } foreach (PasswordBox pb in MyStaticMethods.FindVisualChildren <PasswordBox>(p)) { if (pb.Name == "pb_cr") { pb.Password = Matkhau; } } }