 <p>First - you should be able to just use <a href="http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx" rel="nofollow"><code>File.ReadAllLines</code></a> instead of reading the text and splitting....</p> <p>You may need to trim the results. If there is extra whitespace on the lines, the condition may fail. Try using:</p> <pre><code>if (check[0].Trim() == "1") { </code></pre> <p>This will trim off any whitespace, which should cause your conditional to succeed.</p> <p>You can also put a breakpoint in, and inspect the values in the debugger. This will help you better diagnose the issue.</p>