private string[] YDPhone = { "134", "135", "136", "137", "138", "139", "147", "150", "151", "152", "157", "158", "159", "178", "182", " 183", " 184", "187", "188" };
private string[] LTPhone = { "130", "131", "132", "145", "155", "156", "171", "175", "176", "185", "186" };
private string[] DXPhone = { "133", "149", "153", "173", "177", "180", "181", "189" };
private string[] VPHone = { "170" };
#region 判断是否是移动号码
/// <summary>
/// 判断是否是移动号码
/// </summary>
/// <param name="phone">输入字符串</param>
/// <returns></returns>
protected bool IsYDPhone(string phone)
{
string phoneSub = phone.Substring(0, 3);
if (Array.IndexOf<string>(YDPhone, phoneSub) == -1)
{
return false;
}
else
{
return true;//移动号码
}
}
#endregion
#region 判断是否是联通号码
/// <summary>
/// 判断是否是联通号码
/// </summary>
/// <param name="phone">输入字符串</param>
/// <returns></returns>
protected bool IsLTPhone(string phone)
{
string phoneSub = phone.Substring(0, 3);
if (Array.IndexOf<string>(LTPhone, phoneSub) == -1)
{
return false;
}
else
{
return true;//联通号码
}
}
#endregion
#region 判断是否是电信号码
/// <summary>
/// 判断是否是电信号码
/// </summary>
/// <param name="phone">输入字符串</param>
/// <returns></returns>
protected bool IsDXPhone(string phone)
{
string phoneSub = phone.Substring(0, 3);
if (Array.IndexOf<string>(DXPhone, phoneSub) == -1)
{
return false;
}
else
{
return true;//电信号码
}
}
#endregion
#region 判断是否是虚拟号码
/// <summary>
/// 判断是否是虚拟号码
/// </summary>
/// <param name="phone">输入字符串</param>
/// <returns></returns>
protected bool IsVPhone(string phone)
{
string phoneSub = phone.Substring(0, 3);
if (Array.IndexOf<string>(VPHone, phoneSub) == -1)
{
return false;
}
else
{
return true;//虚拟号码
}
}
#endregion