zoukankan      html  css  js  c++  java
  • 号码运营商判断

    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

    本文来自博客园,作者:.net&new,转载请注明原文链接:https://www.cnblogs.com/wugh8726254/p/7874365.html

  • 相关阅读:
    【luogu4719】动态DP模板 [动态DP]
    【2019.9.22】
    [JSOI2010]连通数[tarjan缩点]
    【2019.9.16】Za
    【2019.9.18】Za
    [USACO14OPEN]GPS的决斗Dueling GPS's [最短路]
    【CF891C】Envy [最小生成树]
    【2019.9.17】Za
    【2019.9.17】
    【luogu3403】跳楼机 [同余最短路]
  • 原文地址:https://www.cnblogs.com/wugh8726254/p/7874365.html
Copyright © 2011-2022 走看看