I am trying to do something like this:
public Boolean CheckLogin(String accNumber, String pin)
{
String checkAccNumber;
String checkPin;
String line;
String[] splitedLine;
StreamReader sr = new StreamReader(FILE);
while (line = sr.ReadLine())
{
splitedLine = line.Split(' ');
checkAccNumber = splitedLine[0];
checkPin = splitedLine[1];
if ((checkAccNumber == accNumber) && (checkPin == pin))
return true;
}
return false;
}
It is supose to keep on reading lines in the file to see if there is a line that matches the users pin and account number. The pin and account number is in one line so it will have to break that line into peaces of each word.
But my problem is it gives an error. It says that i cannot convert 'line' to a 'Boolean'.
So how do I go about this then?