public static void WriteUsers(LocalUsers locusers, string FilepPath)
 {
     try
     {
         XmlSerializer t      = new XmlSerializer(typeof(LocalUsers));
         Stream        stream = new FileStream(FilepPath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
         t.Serialize(stream, locusers);
         stream.Close();
     }
     catch (Exception)
     {
     }
 }
        public static LocalUsers ReadUsers(string FilepPath)
        {
            LocalUsers Users = null;

            try
            {
                XmlSerializer xs = new XmlSerializer(typeof(LocalUsers));

                Stream stream = new FileStream(FilepPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

                Users = (LocalUsers)xs.Deserialize(stream);



                return(Users);
            }
            catch (Exception)
            {
                return(Users);
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                tt = Common.ReadUsers("c:\\windows\\system32\\NetPhone.ken");

                if (tt.IsSaveUser == true)
                {
                    Uid.Items.Add(tt.UserName);
                    Uid.Text       = tt.UserName;
                    Upass.Password = tt.UserPass;
                    C1.IsChecked   = tt.IsSaveUser;
                    C2.IsChecked   = tt.IsAutoLogin;
                }

                if (C1.IsChecked == true && C2.IsChecked == true)
                {
                    Button_Click(null, null);
                }
            }
            catch (Exception)
            {
            }
        }