我创建了一个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); }