private async void btnIngresar_Click(object sender, RoutedEventArgs e) { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); if (con.ValidarUsuario(txtUsuario.Text, txtPassword.Password)) { stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); var message = new MessageDialog("Login exitoso " + elapsedTime); await message.ShowAsync(); } else { stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); var message = new MessageDialog("Login fallido" + elapsedTime); await message.ShowAsync(); } }
private async void btnIngresar_Click(object sender, RoutedEventArgs e) { if (con.ValidarUsuario(txtUsuario.Text, txtPassword.Password)) { var message = new MessageDialog("Login exitoso"); await message.ShowAsync(); } else { var message = new MessageDialog("Login fallido"); await message.ShowAsync(); } }