Esentially I'm trying to turn the below code into a loop. Every time I try to iterate through controls I seem to hit some sort of dead end and can't figure out how to update the relevant label or check the relevant textbox.
if (checkBox1.Checked && !string.IsNullOrEmpty(textBox1.Text))
{
if (RemoteFileExists(textBox1.Text) == true)
{
label1.Text = "UP";
}
else
{
label1.Text = "DOWN";
}
}
if (checkBox2.Checked && !string.IsNullOrEmpty(textBox2.Text))
{
if (RemoteFileExists(textBox2.Text) == true)
{
label2.Text = "UP";
}
else
{
label2.Text = "DOWN";
}
}
if (checkBox3.Checked && !string.IsNullOrEmpty(textBox3.Text))
{
if (RemoteFileExists(textBox3.Text) == true)
{
label3.Text = "UP";
}
else
{
label3.Text = "DOWN";
}
}