From 2a9b253c8ba1bca6ddc4034409ca9a74128dcbf1 Mon Sep 17 00:00:00 2001 From: Sanaxen Date: Thu, 13 Aug 2020 18:21:48 +0900 Subject: [PATCH] Update Form1.cs --- WindowsFormsApp1/WindowsFormsApp1/Form1.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/WindowsFormsApp1/WindowsFormsApp1/Form1.cs b/WindowsFormsApp1/WindowsFormsApp1/Form1.cs index f3f483a..b6c455b 100644 --- a/WindowsFormsApp1/WindowsFormsApp1/Form1.cs +++ b/WindowsFormsApp1/WindowsFormsApp1/Form1.cs @@ -353,9 +353,10 @@ private void button1_Click(object sender, EventArgs e) System.IO.Directory.SetCurrentDirectory(wrkdir); - for (int i = 0; i < listBox1.SelectedIndices.Count; i++) + for (int i = 0; i < 10000; i++) { - if (System.IO.File.Exists("tmp_deepARprediction1_"+i.ToString()+".png")) System.IO.File.Delete("tmp_deepARprediction1_"+i.ToString()+".png"); + if (System.IO.File.Exists("tmp_deepARprediction1_" + i.ToString() + ".png")) System.IO.File.Delete("tmp_deepARprediction1_" + i.ToString() + ".png"); + else break; } pictureBox1.Image = null; @@ -540,9 +541,10 @@ private void button4_Click(object sender, EventArgs e) plot_step = (int)numericUpDown1.Value; System.IO.Directory.SetCurrentDirectory(wrkdir); - for (int i = 0; i < listBox1.SelectedIndices.Count; i++) + for (int i = 0; i < 10000; i++) { if (System.IO.File.Exists("tmp_deepARprediction5_" + i.ToString() + ".png")) System.IO.File.Delete("tmp_deepARprediction5_" + i.ToString() + ".png"); + else break; } pictureBox1.Image = null; @@ -1294,9 +1296,10 @@ private void button14_Click(object sender, EventArgs e) button6_Click(sender, e); System.IO.Directory.SetCurrentDirectory(wrkdir); - for (int i = 0; i < listBox1.SelectedIndices.Count; i++) + for (int i = 0; i < 10000; i++) { if (System.IO.File.Exists("tmp_deepARprediction1_" + i.ToString() + ".png")) System.IO.File.Delete("tmp_deepARprediction1_" + i.ToString() + ".png"); + else break; } if (System.IO.File.Exists("tmp_deepARprediction2.png")) System.IO.File.Delete("tmp_deepARprediction2.png"); @@ -1410,9 +1413,10 @@ private void button15_Click(object sender, EventArgs e) button6_Click(sender, e); System.IO.Directory.SetCurrentDirectory(wrkdir); - for (int i = 0; i < listBox1.SelectedIndices.Count; i++) + for (int i = 0; i < 10000; i++) { if (System.IO.File.Exists("tmp_deepARprediction5_" + i.ToString() + ".png")) System.IO.File.Delete("tmp_deepARprediction5_" + i.ToString() + ".png"); + else break; } if (System.IO.File.Exists("tmp_deepARprediction6.png")) System.IO.File.Delete("tmp_deepARprediction6.png");