Reading from files in an if statement

Okay so im making a program which is like a rank system, i want it to read the password and username from an external .txt file,

would it be as simple as
if(H:\\PWs\\pass==pw

or would there be more to it?
Topic archived. No new replies allowed.