How to pull information from multiple text files in c#
<p>I have a project that deals with barcodes. It is basically an inventory tracking program that tells us what we have in stock at any given time. Each barcode has a text file containing relevant information. Each file contains the following lines of information:</p>

<ol>
<li>"Office Printer"        &lt;- this is the item description</li>
<li>"1"                     &lt;- 0 equals out of stock, 1 equals in stock</li>
<li>"irrelevant information" &lt;- any additional information not used in sorting </li>
</ol>

<p>There are approximately 200+ different text files That I need to search first through the item description and then search again through those to see if they are in stock. Ideally it would then display an integer listing the number in stock, but it could also just display the names of the text files if that would be easiest. Here is my code so far. comboBox1 has a drop down list of possible items to search by. richTextbox1 is what I have setup to display the search results. Right now it only shows one "1".</p>

<p><strong>EDIT</strong><br>
Thanks to VBRonPaulFan for the breakthrough. This shows how many items are in stock based on the selection of the comboBox. The only other thing I am going to research is have it display the number of items in stock rather than listing them all. Thanks!</p>

<pre><code>    private void searchButton_Click(object sender, EventArgs e)
    {
        richTextBox1.Text = "";

        foreach (string fileName in Directory.GetFiles("C:\\ITRS_equipment_log\\", "*.txt"))
        {

            using (StreamReader sw = new StreamReader(fileName))
            {
                string Description = sw.ReadLine();
                bool InStock = sw.ReadLine().Trim() == "1";

                if (Description.Contains(comboBox1.Text) &amp;&amp; InStock == true)
                {
                    richTextBox1.AppendText("Item '" + Description + "' is " + (InStock ? "in" : "not in") + " stock.\r\n");
                }
            }
        }
    }
</code></pre>
