c# - Im trying to make a simple password confirmation -


i'm trying compare 2 strings or see if equal.

static void main(string[] args)         {              console.writeline("insert password.");              string password1 = convert.tostring(console.readline());              system.threading.thread.sleep(1000);             console.writeline("confirm password.");              string password2 = convert.tostring(console.readline());              if (password1.equals(password2))             {                 console.writeline("passwords match");             }             else             {                 console.writeline("error: passwords not match");             }              console.writeline("press enter continue");          } 

so if 2 strings equal match, problem is, after input both strings console exits out. extremely appreciated.

use console.readkey() after console.writeline();, wait until respond key,

 console.writeline("press enter continue");  console.readkey(true); 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -