string phone = textBox1.Text.Trim();
if (Regex.IsMatch(phone, @"^\d{11}$"))
{
//移动号码 11位手机号
MessageBox.Show("移动号码");
}
else if (Regex.IsMatch(phone, @"^(\d{4}|\d{3})-(\d{7,8})$|^\((\d{4}|\d{3})\)(\d{7,8})$"))
{
//长途号码 0436-1111111
MessageBox.Show("长途号码");
}
else if (Regex.IsMatch(phone, @"(^(\d{7,8})$)"))
{
//家庭好固定号 7位座机号 8位座机号
MessageBox.Show("家庭好固定号");
}
else
{
MessageBox.Show("什么也不是");
return;
}