private void login(CommandStack stack) { var u = options.UserName; var p = options.Password; if (u.IsNullOrWhiteSpace() && stack.Any()) { u = stack.Pop(); } else { txtOut.WriteLine("User: "******"Enter password: "******"Login for " + u + " " + (result ? " success" : "failed")); } catch (Exception ex) { txtOut.WriteLine("Login failed"); } }
private void login(CommandStack stack) { var userName = options.UserName; var passWord = options.Password; if (userName.IsNullOrWhiteSpace()) { if (stack.Any()) { userName = stack.Pop(); } else { txtOut.WriteLine("User: "******"Enter password: "******"Login for {userName} {(result ? " success" : "failed")}"); } catch (Exception) { txtOut.WriteLine("Login failed"); } }