/*Marcus page*/ private void RedirectMarcusHome(object sender, RoutedEventArgs e) { ReadConfigFile();//Marcus's config file //check if user set a password for SecLogin if (ConfigPass.Equals("n")) { //pw not set ContentWrapper.NavigationService.Navigate(new MarcusHome()); } else { //user has password set string passwordPromptBox = new InputBox("\nEnter Password").ShowDialog(); if (passwordPromptBox.Equals(ConfigPass))//password match { ContentWrapper.NavigationService.Navigate(new MarcusHome()); } else { MessageBox.Show("Wrong password!");//password not match passcount += 1; if (passcount == 2) { string sMessageBoxText = "Do you want to reset your password??"; string sCaption = "Multiple failed password attempts"; MessageBoxButton btnMessageBox = MessageBoxButton.YesNo; MessageBoxImage icnMessageBox = MessageBoxImage.Warning; MessageBoxResult rsltMessageBox = MessageBox.Show(sMessageBoxText, sCaption, btnMessageBox, icnMessageBox); switch (rsltMessageBox) { case MessageBoxResult.Yes: /* ... */ MarcusTwilio msg = new MarcusTwilio(); msg.calltwilio(ConfigPhoneNo, "A reset for your password was requested." +ConfigPass); MessageBox.Show("A reset has been sent to your SMS / Email"); passcount = 0; break; case MessageBoxResult.No: /* ... */ break; } passcount = 0; } } } }
}//LoginLogoutDetector public static void SendSMS() { ReadConfigFile(); if (LoginAttemptCount.ToString().Equals(ConfigTimes))//3 should change to dynamic variable for final presentation { // new Thread(SendEmail).Start(); string pcname = System.Environment.MachineName; if (!ConfigPhoneNo.Equals("00000000") && ConfigSMS.Equals("Yes")) { MarcusTwilio mt = new MarcusTwilio(); mt.calltwilio("96445769", "\nWARNING: Quartz Detected Your Computer " + pcname + " had " + LoginAttemptCount + " Failed Login Attempts detected at " + SMSlogintimestamps);//Change to dynamic variable in final presentation SMSlogintimestamps = ""; LoginAttemptCount = 0; } else if(ConfigPhoneNo.Equals("00000000")) { MessageBox.Show("There were " + LoginAttemptCount + " failed login attempts on " + pcname + " At time" + SMSlogintimestamps +"\nWe tried sending you an SMS, but you didn't set a valid handphone number"); } else { MessageBox.Show("There were " + LoginAttemptCount + " failed login attempts on " + pcname + " At time" + SMSlogintimestamps + "\nWe didn't send you an SMS as you requested"); } if (ConfigEmail.Equals("No")) { MessageBox.Show("We tried sending an email, but didnt send it as per requested"); } } }