title: Using StreamReader to check if a file contains a string
body: <p>I have a string that is <code>args[0]</code>.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>static void Main(string[] args)
  {
      string latestversion = args[0];
      // create reader &amp; open file
      using (StreamReader sr = new StreamReader("C:\\Work\\list.txt"))
      {
          while (sr.Peek() &gt;= 0)
          {
              // code here
          }
     }
  }
  </code></pre>
  
  <p>I would like to check if my <code>list.txt</code> file contains <code>args[0]</code>. If it does, then I will create another process <code>StreamWriter</code> to write a string <code>1</code> or <code>0</code> into the file. How do I do this?</p>