asp.net实现手机号码归属地查询

 protected void Button1_Click(object sender, EventArgs e)
        {
            if (Regex.IsMatch(TextBox1.Text.Trim(), @"^\d{7,11}$"))
            {
                string num = TextBox1.Text.Trim().Substring(0, 7);
                DataRow dr = DAL.oledb.ExecuteDataRow("db.mdb", "select * from list where num = ?", num);
                if (dr != null)
                {
                    Response.Write(TextBox1.Text.Trim() + "<br />" + dr["city"].ToString() + "<br />" + dr["cardtype"].ToString());
                }
            }
        }

posted @ 2014-07-23 10:14  谯旭  阅读(388)  评论(0编辑  收藏  举报