I built a helpdesk version of a program that would parse out certain information. Now, I am trying to automate it using the same code under a load event and I just can't get it to work. The original code was worked on by .paul. and he did a great job! The original forum is located here.

My Code:
vb.net Code:
  1. Imports System.Text
  2. Imports Microsoft.VisualBasic.FileIO
  3. Imports System.Collections.ObjectModel
  4.  
  5.  
  6. Public Class SecurityParser
  7.  
  8.     Private Sub SecurityParser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  9.  
  10.         ' Fill textbox1 with the original DEBOUT.TXT
  11.         '
  12.         Dim DeboutTXT As String = My.Settings.DeboutLocation
  13.         Dim fileContents As String
  14.         fileContents = My.Computer.FileSystem.ReadAllText(DeboutTXT)
  15.         TextBox1.Text = fileContents
  16.  
  17.         ' Search the contents of the textbox for the keywords
  18.         '
  19.         Dim lines As New List(Of String)(IO.File.ReadAllLines(DeboutTXT))
  20.         Dim matches = (From line In lines Where line.contains("Login") Or line.contains("Username") _
  21.                      Or line.contains("Logout") Or line.contians("rpt") Or line.contains("USERNAME") _
  22.                      Select "LINE " & lines.IndexOf(line) & ": " & line).toarray
  23.  
  24.         If matches Is Nothing OrElse matches.length = 0 Then MsgBox("Nothing found") : Return
  25.         TextBox2.Lines = matches
  26.  
  27.         ' Create the audited file, will be moved by the form1.load event in the background worker
  28.         '
  29.         My.Computer.FileSystem.WriteAllText(My.Settings.XFER_Dir & "AM-AUDIT.TXT", TextBox2.Text, False)
  30.  
  31.     End Sub
  32. End Class

I am getting one error, which is:
Code:
Error	1	Expression of type 'System.Collections.Generic.List(Of String)' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.	C:\Documents and Settings\mbutler\My Documents\Visual Studio 2008\Projects\Briad Backup\Briad Backup\SecurityParser.vb	20	37	Briad Backup
I did not need to call any references for the other program and I am just wondering if I am missing something. Any help is much appreciated.