private async static void OnSaveRegisterationClick(object sender, EventArgs e) { try { if (DataOperation.WorkingItem != null && (((DataOperation.WorkingItem.InputedPW1).Equals(DataOperation.WorkingItem.InputedPW2)) && DataOperation.WorkingItem.InputedPW1 != null) && (DataOperation.WorkingItem.InputedName.Equals("ThisApplication"))) { Console.WriteLine("what is wrong? {0}", DataOperation.WorkingItem.InputedName.Equals("ThisApplication").ToString()); AESKEY.Set_AesKey(DataOperation.WorkingItem.InputedPW1); Item appacount = new Item { NameofApplication = DataOperation.WorkingItem.InputedName, PW = AESKEY.EncryptStringToBytes_Aes(DataOperation.WorkingItem.InputedPW1), Date = DateTime.UtcNow.ToString() }; if ((await DataOperation.RealTimeDatabase.CreatAPPAccount(appacount))) { PageContain.Children.Clear(); DataOperation.LogedIN = true; CreateListItemView(); } } else { } } catch { } }
public static void LoginEvent(object sender, EventArgs e) { string encryloginpw; AESKEY.Set_AesKey(DataOperation.WorkingItem.InputedPW1); encryloginpw = AESKEY.EncryptStringToBytes_Aes(DataOperation.WorkingItem.InputedPW1); if (encryloginpw.Equals(DataOperation.AppPW) && DataOperation.AppPW != null) { DataOperation.LogedIN = true; RetrunListView(); } else { Label infolabe = new Label { Text = "your passowrd is wrong" }; PageContain.Children.Add(infolabe); } }
private async static void OnAddSaveClick(object sender, EventArgs e) { try { if (DataOperation.WorkingItem != null && (((DataOperation.WorkingItem.InputedPW1).Equals(DataOperation.WorkingItem.InputedPW2)) && DataOperation.WorkingItem.InputedPW1 != null) && DataOperation.WorkingItem.InputedName != null && DataOperation.WorkingItem.InputedUserName != null && (!((DataOperation.WorkingItem.InputedName).Equals("ThisApplication")))) { Item newitem = new Item { NameofApplication = DataOperation.WorkingItem.InputedName, UserName = AESKEY.EncryptStringToBytes_Aes(DataOperation.WorkingItem.InputedUserName), PW = AESKEY.EncryptStringToBytes_Aes(DataOperation.WorkingItem.InputedPW1), Date = DateTime.UtcNow.ToString() }; if ((await DataOperation.RealTimeDatabase.AddItemAsync(newitem))) { PageContain.Children.Clear(); RetrunListView(); } } else { Label infolabe = new Label { Text = "It seems something is wrong with your input", FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.Center }; PageContain.Children.Add(infolabe); } } catch { } }
public void EncryptEntry() { InputedUserName = AESKEY.EncryptStringToBytes_Aes(InputedUserName); InputedPW1 = AESKEY.EncryptStringToBytes_Aes(InputedPW1); }
public void DecryptEntry(EntryData entrydata) { EntryinWork = entrydata; InputedUserName = AESKEY.DecryptStringFromBytes_Aes(InputedUserName); InputedPW1 = AESKEY.DecryptStringFromBytes_Aes(InputedPW1); }