Advancing a timestamp by a day when an exception is encountered
<p>In my code, I am able to delete dated files from a folder.</p>

<p>But the date must appear in certain <code>*.dat</code> files, otherwise nothing happens.</p>

<p>Some days are not included in these files; for example, holidays are skipped.</p>

<p>In this case I am encountering a problem.</p>

<p>So, if I am on one of these days, how can I advance to the next day after failing?</p>

<pre><code>    private void button1_Click(object sender, EventArgs e)
    {
        string Destinationdead = "C:\\test\\test1";

        string todaysDate;
        todaysDate = dateTimePicker1.Text;
        int FinalDate4 = 0;

        BLWriterClass writerdelete1 = new BLWriterClass();

        writerdelete1.OpenDirectory(Destinationdead);
        writerdelete1.OpenSecurityBySymbol(SecSymbol);
        FinalDate4 = int.Parse(todaysDate);

        {
            try
            {
                writerdelete1.OpenDirectory(Destinationdead);
                writerdelete1.OpenSecurityBySymbol(SecSymbolbol);
                FinalDate4 = int.Parse(todaysDate);

                writerdelete1.OpenDirectory(Destinationdead);
                writerdelete1.OpenSecurityBySymbol(SecSymbol);
                int idate = Convert.ToInt32(dateTimePicker1.Text);
                int itodate = Convert.ToInt32(dateTimePicker2.Text);
                writerdelete1.DeleteSecRecords(idate, itodate);
            }
            catch (Exception)
            {

            }
        }
        writerdelete1.CloseSecurity();
        writerdelete1.CloseDirectory();
    }
</code></pre>
