static void Main(string[] args) { var reader = new SingleLineReader(@"File location"); var lineNumbers = reader.FindLineNumberAndPosition("exclaimer"); foreach (var number in lineNumbers) { Console.WriteLine(number); } Console.ReadLine(); }
private void StartSearch(object sender, RoutedEventArgs e) { if (Words.AllWords.Count < 1) { MessageBox.Show("Please enter in some words (File > Search Words", "Please enter words", MessageBoxButton.OK, MessageBoxImage.Stop); } foreach (var allWord in Words.AllWords.Where(allWord => !SearchWords.Word.Contains(allWord))) { SearchWords.Word.Add(allWord); } var slr = new SingleLineReader(FilePath); var results = slr.FindTextInSingleFile(SearchWords); foreach (var result in results) ViewModel.Records.Add(result); }