Example #1
0
 private void settingsTsmi_Click(object sender, EventArgs e)
 {
     string[] data = { "Login", "Password" };
     if (Forms.ChangeInfo(ref data) == DialogResult.OK)
     {
         string oldLog = accountSddb.Text;
         if (data[0] != "" || data[0] != "Login")
         {
             accountSddb.Text = data[0];
         }
         else
         {
             data[0] = accountSddb.Text;
         }
         if (data[1] != "" || data[1] != "Password")
         {
             File.Delete(path);
             path = FileSystem.FolderPath + "/" + EncryptionSystem.EncodePathFile(data[0] + data[1]) + ".dat";
         }
         else
         {
             foreach (var file in Directory.GetFiles(FileSystem.FolderPath))
             {
                 if (EncryptionSystem.EncodePathFile(file).Contains(oldLog))
                 {
                     File.Delete(path);
                     path = file.Replace(oldLog, data[0]);
                 }
             }
         }
     }
 }
Example #2
0
 private void createAccountBtn_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (ValidSystem.IsNotEmpty(logProblemLbl, loginTb.Text, passwordTb.Text))
     {
         foreach (var file in Directory.GetFiles(FileSystem.FolderPath))
         {
             if (EncryptionSystem.EncodePathFile(file).Contains(loginTb.Text))
             {
                 logProblemLbl.Text = "Account with similar login already exist.";
                 return;
             }
         }
         File.Create(FileSystem.FolderPath + "/" + EncryptionSystem.EncodePathFile(loginTb.Text + passwordTb.Text) + ".dat");
         File.SetAttributes(FileSystem.FolderPath + "/" + EncryptionSystem.EncodePathFile(loginTb.Text + passwordTb.Text) + ".dat", FileAttributes.Hidden);
         logInBtn_Click(sender, e);
     }
 }
Example #3
0
 private void logInBtn_Click(object sender, EventArgs e)
 {
     if (ValidSystem.IsNotEmpty(logProblemLbl, loginTb.Text, passwordTb.Text))
     {
         if (File.Exists(FileSystem.FolderPath + "/" + EncryptionSystem.EncodePathFile(loginTb.Text + passwordTb.Text) + ".dat"))
         {
             this.Hide();
             main.Login(loginTb.Text, FileSystem.FolderPath + "/" + EncryptionSystem.EncodePathFile(loginTb.Text + passwordTb.Text) + ".dat");
             main.Show();
             loginTb.Focus();
             loginTb.Text       = "";
             passwordTb.Text    = "";
             logProblemLbl.Text = "";
         }
         else
         {
             logProblemLbl.Text = "Your input is failed or this account is not exist. You can create a new account by clicking the button below.";
             passwordTb.Text    = "";
         }
     }
 }