Q:

Code to search text file for exact string and performing action if found is failing

So, I wrote some code that is suppose to read a text file and then check for an instance of a specific string. If that string exists it will need to perform an action. I have added some message boxes to let me know the progress of the function. The problem is, it is not finding the word. Here is my code:
private void test2_Click(object sender, EventArgs e)
{
    StreamReader objReader = new StreamReader("C:\\testing\\mslogon.log");
    string sLine = "";
    ArrayList arrText = new ArrayList();
    MessageBox.Show("File Read");

    while (sLine != null)
    {
        sLine = objReader.ReadLine();
        if (sLine != null)
        {
            arrText.Add(sLine);
        }
    }

    if (arrText.Contains("Invalid"))
    {
        MessageBox.Show("Word Invalid Found");
    }
    else
    {
        MessageBox.Show("Nada");
    }
}

A:

Right now, you are checking arrText for an element that is exactly equal to "Invalid".  If "Invalid" is embedded in some larger string, it will not find it.
To check whether any of the strings contain Invalid, you'd have to do:
foreach(var line in arrText)
{
    if (line.Contains("Invalid")) { MessageBox.Show("Word 'Invalid' Found"); break; }
}

Using File.ReadAllText as @Alexei mentions would enable you to do something you are wanting to do and would look something like this:
String wholeFile = File.ReadAllText();
if (wholeFile.Contains("Invalid")) { 
    MessageBox.Show("Word 'Invalid' Found"); 
} else {
. . .

