A better method would be:
1) Get password
2) Apply encryption scheme (MD5 works)
3) Check it against password that already has been encrypted

the
Code:
if (password == "mypassword")
method suffers one huge problem. I can open your executable with pretty much any text editor and see the password.