public String FindWord(String strWord, String strGameTimeLeft) { // Read every line in the file. string wordFile = HttpContext.Current.Server.MapPath("~/sowpods.txt"); using (StreamReader reader = new StreamReader(wordFile)) { string line; while ((line = reader.ReadLine()) != null) { if (string.Equals(strWord, line)) { LetterValues letters = new LetterValues(); return("found the word!<BR><BR>" + strWord + "<BR><BR>score : " + letters.getWordValue(strWord, strGameTimeLeft)); } // Do something with the line. //string[] parts = line.Split(','); } return("<BR><BR>No such word: " + strWord); } }
public String FindWord(String strWord, String strGameTimeLeft) { // Read every line in the file. string wordFile = HttpContext.Current.Server.MapPath("~/sowpods.txt"); using (StreamReader reader = new StreamReader(wordFile)) { string line; while ((line = reader.ReadLine()) != null) { if (string.Equals(strWord, line)) { LetterValues letters = new LetterValues(); return "found the word!<BR><BR>" + strWord + "<BR><BR>score : " + letters.getWordValue(strWord, strGameTimeLeft); } // Do something with the line. //string[] parts = line.Split(','); } return "<BR><BR>No such word: " + strWord; } }