日期:2019-08-07  浏览次数:2302 次

bool ok = true;
 
Verify(tbDomainName.Text, "Domain Name must be specified.", ref ok);
if(ok){
 
}
 
 
private void Verify(string s, string msg, ref bool ok)
{
if (ok && String.IsNullOrEmpty(s))
{
MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
ok = false;
}
}