C# Creating streamwriter files IF value is greater than or less than value?
<p>I was wondering if it was possible to write a new streamwrite output file when comparing two values. One of my values is in a <code>LabelBox</code> the other is in a <code>ListBox</code> and is populated by an input file. The purpose of it is suppose to be that this new value should change only when the LabelBox value is GREATER than the Listbox value. See the following code:</p>

<pre><code>if (MaxRolls == 0)
{
    Random getMax = new Random();
    totalmoneyLabel.Text = "";
}
else if (RollCount &gt;= MaxRolls)
{
    //
    if (runningTotal &gt;= highscore)
    {
        StreamWriter outputFile;
        outputFile = File.CreateText("HighScore.txt");
        outputFile.WriteLine("New Highscore!!");
        outputFile.WriteLine(totalmoneyLabel.Text);
        outputFile.Close();
    }
    //

    MaxRolls = 25;
    RollCount = 0; 
    runningTotal = 0;
    totalmoneyLabel.Text = "$0.00";
    Show();
    MessageBox.Show("You lost!");

    return;
}
</code></pre>
