Cannot implicitly convert type bool to string when trying to read a line from a file. c #
<p>I am getting an error and I don't know why because I am not really good with c# and I am following a guide and it looks very similar. So when I assign my str variable to the StreamReader variable, inputFile, I get an error that says I cannot implicitly convert type bool to string.   </p>

<pre><code>if (openFile.ShowDialog() == DialogResult.OK)
                    {
                        StreamReader inputFile = File.OpenText(openFile.FileName);

                        String str;

                        // Getting the error here
                        while (str = inputFile.ReadLine() != null)
                        {
                            str = inputFile.ReadLine();
                            listBox1.Items.Add(str);
                        }

                    } else
                    {
                        MessageBox.Show("Canceled");
                    }
</code></pre>