当前位置:七道奇文章资讯网站建设网站编程
日期:2011-01-10 12:02:00  来源:本站整理

asp.net手机号码归属地查询代码[网站编程]

赞助商链接



  本文“asp.net手机号码归属地查询代码[网站编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

create table t_phone
(
id int identity(1,1) not null primary key,
startno varchar(11) not null,
endno varchar(11) not null,
cityname nvarchar(50) not null
)用户查询

sqlconnection con = new sqlconnection(system.configuration.configurationmanager.connectionstrings["conn"].tostring());
con.open();
string strtestno = this.userphoneno.text.trim();
sqlcommand cmd = new sqlcommand();
cmd.connection = con;
cmd.commandtext = "select cityname from t_phone where startno<=@no and endno >=@no";
sqlparameter sp = new sqlparameter("@no", sqldbtype.varchar, 50);
sp.value = strtestno;
cmd.parameters.add(sp);
object ob = cmd.executescalar();
messagebox.show(ob.tostring());
 

代码.

1 using (sqlconnection con = new sqlconnection(system.configuration.configurationmanager.connectionstrings["conn"].tostring()))
2 {
3 sqlcommand cmd = new sqlcommand();
4 cmd.connection = con;
5 cmd.commandtext = "delete from t_phone";
6 if (con.state == connectionstate.closed)
7 {
8 con.open();
9
10 }
11 cmd.executenonquery();
12 if (folderbrowserdialog1.showdialog() == dialogresult.ok)
13 {
14 string strpath = this.folderbrowserdialog1.selectedpath;
15 string[] files = directory.getfiles(strpath, "*.txt", searchoption.topdirectoryonly);
16 string[] strs = new string[files.length];
17 int i = 0;
18 foreach (string var in files)
19 {
20 strs[i] = path.getfilenamewithoutextension(var);
21
22 string[] strtext = file.readalllines(var, encoding.default);
23 foreach (string var1 in strtext)
24 {
25 string[] strsplit = var1.split('-');
26 string strstartno = strsplit[0];
27 string strendno = strsplit[1];
28 string strcityname = strsplit[2];
29 cmd = new sqlcommand("insert into t_phone (startno,endno,cityname) values(@startno,@endno,@cityname)", con);
30 sqlparameter[] sp = new sqlparameter[3];
31 sp[0] = new sqlparameter("@startno", strstartno);
32 sp[1] = new sqlparameter("@endno", strendno);
33 sp[2] = new sqlparameter("@cityname", strs[i]+strcityname);
34 cmd.parameters.addrange(sp);
35 cmd.executenonquery();
36
37 }
38 i++;
39
40 }
41
42 }
43 }


  以上是“asp.net手机号码归属地查询代码[网站编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
  • ASP利用正则表达式提取内容
  • nginx 反向代理iis支持 ASP脚本设置
  • <b>ASP.NET安全设置防备ASPXSpy</b>
  • Ubuntu Server+Apache 运行 asp.net
  • 怎样ASP.NET MVC调用Delphi开辟的Web报表
  • 学习ASP.NET需求举行的步骤办法
  • ASP.NET脚本过滤-避免跨站脚本攻击
  • Asp WinHttp.WinHttpRequest.5.1 对象利用详解
  • ASP防XSS注入函数
  • Asp 防备CC攻击模块 (Anti-CC.asp)
  • metasploit metasploit 中文系统安装失利问题
  • Ubuntu 11下安装Metasploit Pro 4.0.0
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .