首 页文章中心下载中心动画频道客户留言泉州论坛资讯中心游戏中心繁體中文
设为首页
加入收藏
联系我们
您当前的位置:今日下载站 -> Visual Basic -> 文章内容-> 重庆移动通话清单统计(EXCEL文件从重庆移动网上下载) 退出登录 用户管理
栏目导航
· 办公自动化 · 软件工程
· Java/J2EE/JSP · VC++/C#/C
· Visual Basic · Delphi/Perl
· ASP/PHP/.NET/XML · PowerBuilder
· SQL Server/My SQL · Oracle
· Access · DB2/FOXPRO
· Windows · Linux
· Unix · CorelDRAW
· AutoCAD/Firework · Photoshop
· Dreamweaver · Flash/3DS Max
· 网页特效 · 安全防护
热门文章
相关文章
· [图文] 超炫效..
· [图文] 实用教..
· [图文] 独家视..
· [图文] 用历史..
· [图文] Photo..
· [图文] 用两个..
· [图文] photo..
· [图文] 菜鸟学..
· [图文] Photo..
· [图文] 菜鸟扣..

重庆移动通话清单统计(EXCEL文件从重庆移动网上下载)

作者:佚名  来源:本站整理  发布时间:2006-12-22 12:58:46  发布人:今日下载站

减小字体 增大字体

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>科长电话清单</title>
</head>

<body>
<table border="1" width="90%" align="center">
  <tr align="center" bgcolor="#E6E6E6">
   <td>查询号码</td><td>对方号码</td><td>通话时间</td><td>时长</td><td>类型</td><td>费用</td>
  </tr>
  <%
 建立Connection对象
  Dim db,rs,strSql,dbxls
  dbxls="book1.xls"
  Set db = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&dbxls&"") & ";Extended Properties=Excel 8.0;"
 db.Open connstr
  打开记录集,表名一定要以"[表名$]"的格式
  strSql="Select 查询号码,对方号码,通话时间,时长,类型,费用 From [Sheet1$] order by 类型"
  Set rs=db.Execute(strSql)
  循环读取所有行
   n=0
   dim ydcount,notydcount,hycount,dxcount移动通话累计和非移动通话累计分钟数,话费合计,短信费合计
   ydcount=0
   notydcount=0
   hycount=0
   hycount=hycount+28加月租费
   dxcount=0
  Do While Not rs.EOF
   n=n+1
   if trim(rs("类型"))="主叫短信" then dxcount=dxcount+ccur(rs("费用"))
    if rs("费用")="28"  or rs("类型")="(元)" then
    路过
    else
    计算和移动用户的通话累计分钟数
    if rs("类型")="被叫" or rs("类型")="主叫" then
    if instr("134|135|136|137|138|139|159",left(rs("对方号码"),3))>0 then isyd=1 else isyd=0
    hycount=hycount+CCur(rs("费用"))计算通话费用
    select case isyd
    case 1
    tstr=split(rs("时长"),":")
    s=cint(tstr(0))
    f=cint(tstr(1))
    m=cint(tstr(2))
    s=s*60
    if m<>0 then m=1
    tempcount=s+f+m
    ydcount=ydcount+tempcount
    case 0
    tstr=split(rs("时长"),":")
    s=cint(tstr(0))
    f=cint(tstr(1))
    m=cint(tstr(2))
    s=s*60
    if m<>0 then m=1
    tempcount=s+f+m
    notydcount=notydcount+tempcount
    end select
    end if
  
   Response.Write "<tr align=\center\>"
   Response.Write "<td>" & rs("查询号码") & "</td>"
   Response.Write "<td>" & rs("对方号码") & "</td>"
   Response.Write "<td>" & rs("通话时间") & "</td>"
   Response.Write "<td>" & rs("时长")&"|"&tempcount& "</td>"
   Response.Write "<td>" & rs("类型") & "</td>"
   Response.Write "<td>" & rs("费用") & "</td>"
   Response.Write "</tr>"
   end if
   rs.MoveNext
  Loop


  关闭对象
  rs.Close
  Set rs=nothing
  db.Close
  Set db=Nothing
  %>
</table>
<%response.write"<div align=center>网内通话:"&ydcount&"分钟  网外通话:"&notydcount&"分钟  合计:"&ydcount+notydcount&"分钟 平均每分钟:"&round(hycount/(ydcount+notydcount),3)&"元 通话费:"&hycount&"元 短信费:"&dxcount&"元</div>" %>
</body>
</html>



[] [返回上一页] [打 印] [收 藏]
上一篇文章: VB 和C#代码比较
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论…]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登录
Copyright © 2002-2006 cntoday.com.cn. All Rights Reserved .
Powered by:NewAsp SiteManageSystem Version 2.1 SP1 1030