我創建了一個Windows窗體應用程序,它有一個TextBox
,您可以在其中輸入一個由我的程序修改的數字。如何跳躍週期如果?
我創建了if
子句,如果TextBox.Text
爲空,我不想運行計算。但即使我將TextBox
留空,由於沒有任何價值,異常情況也會上升。如何跳過此if
條款?
private void button1_Click(object sender, EventArgs e)
{
string strMP3Folder = @"C:\Users\Stefano\Music\shake.mp3";
string strMP3OutputFilename = @"C:\Users\Stefano\Music\funziona2.mp3";
using (Mp3FileReader reader = new Mp3FileReader(strMP3Folder))
{
int count = 1;
Mp3Frame mp3Frame = reader.ReadNextFrame();
System.IO.FileStream _fs = new System.IO.FileStream(strMP3OutputFilename, System.IO.FileMode.Create, System.IO.FileAccess.Write);
double valoreIniziale = 0;
if (textBox2.Text != null)
{
valoreIniziale = Convert.ToDouble(textBox2.Text);
}
double valorefinale = 1000000;
if (textBox1.Text != null)
{ valorefinale = Convert.ToDouble(textBox1.Text); }