Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int loginCheck()
- {
- //-----------------------------------------------------------------
- string[] users = File.ReadLines("Username_Passwords").ToArray();
- //line of text file added to array
- //-----------------------------------------------------------------
- for (int i = 0; i < users.Length; i++)
- {
- string[] usernameAndPassword = users[i].Split('_');
- //usernames and passwords separated by '_' in file, split into two strings
- if (_username == usernameAndPassword[0] && _password == usernameAndPassword[1])
- {
- return 1;
- //return 1, could have used bool
- }
- else
- {
- return 0;
- }
- }
- public int loginCheck() {
- //-----------------------------------------------------------------
- string[] users = File.ReadLines("Username_Passwords").ToArray();
- //line of text file added to array
- //-----------------------------------------------------------------
- for (int i = 0; i < users.Length; i++) {
- string[] usernameAndPassword = users[i].Split('_');
- //usernames and passwords separated by '_' in file, split into two strings
- if (_username == usernameAndPassword[0] && _password == usernameAndPassword[1]) {
- return 1;
- //return 1, could have used bool
- }
- else {
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement