I am doing log-in panel in c# form application. I do not want use database. I should take userID and password from txt file...
For example, the txt file has 5 user ID and 5 password. How can I take needing userID and password from txt?
I am doing log-in panel in c# form application. I do not want use database. I should take userID and password from txt file...
For example, the txt file has 5 user ID and 5 password. How can I take needing userID and password from txt?
Basic steps for reading from a file is covered in MSDN How-to guide Read From a Text File
Something like following (assuming each line contains user name and password separated by space):
var usersAndPasswords = File.ReadAllLines(@"c:\passwords.txt")
.Select(s => s.Split())
.Select(r => new {User = r[0], Password = r[1]);
Note: storing passwords in plain text is normally bad idea, but if you are building personal "read all my Facebook accounts" type of application it may be ok.