只保留数字asp代码

‘——————————只保留数字—————————————-
Function TrimCH(key)
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = “[^~*xX0-9]”
TrimCH =objRegExp.Replace(key,””)
Set objRegExp = Nothing
End Function
..

ASP判断是否手机访问网站

if InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/vnd.wap.wml")>0 then
response.redirect   "wap.asp" ‘如果是手机访问则跳转到wap.asp
response.end
else
response.redirect   "default.asp" ‘如果电脑访问跳转到首页
response.end
end if

ASP去除JS,CSS等代码

<%
Function FilterHTML(strToFilter)
Dim strTemp
strTemp = strToFilter
While Instr(1,strTemp,"<") AND Instr(1, strTemp, ">")
    strTemp = Left(strTemp, Instr(1, strTemp, "<")-1) & Right(strTemp, Len(strTemp)-Instr(1,strTemp, ">"))
WEnd
FilterHTML = strTemp
End Function

public Function RemoveHTML(strHTML)
ON ERROR RESUME NEXT
Dim objRegExp, strOutput
strHTML = replace(strHTML," ","")
‘strHTML = replace(strHTML,chr(13),"")
‘strHTML = replace(strHTML,chr(10),"")
strHTML = replace(strHTML,chr(32),"")
       
    Set objRegExp = New Regexp
    objRegExp.IgnoreCase = True        ‘忽略大小写
    objRegExp.Global = True        ‘设置为全文搜索
    objRegExp.Pattern = "<script.+?>[\s\S]+?<\/script>"
    strOutput = objRegExp.Replace(strHTML, "")
    objRegExp.Pattern = "<style.+?>[\s\S]+?<\/style>"
    strOutput = objRegExp.Replace(strOutput, "")
    objRegExp.Pattern = "<.+?>"        ‘取闭合的<>
    strOutput = objRegExp.Replace(strOutput, "")
       
    strOutput = Replace(strOutput, "<", "〈")
    strOutput = Replace(strOutput, ">", "〉")
    RemoveHTML = strOutput  
    Set objRegExp = Nothing
End Function

Function NoHtml(htmlCode)
Dim text
text = htmlCode
text = FilterHTML(text)
text = RemoveHTML(text)
text=replace(text,chr(13)&chr(10),"<br>")
NoHtml=text
End Function
‘调用
‘code =HTML代码
‘code = NoHtml(code)
%>

asp链接oracle

首先在microsoft ODBC 管理中的系统DSN中加入oracle的驱动 then

<%
Set Conn_ODBC=Server.CreateObject("ADODB.Connection") ‘创建名为Conn的Connection对象
Conn_ODBC.Open("DSN=OracleDSN;uid=soft;pwd=soft;") ‘建立连接
SET RS_ODBC=SERVER.CreateObject("ADODB.RECORDSET")
SQL_ODBC="select * from T_USER"
RS_ODBC.OPEN SQL_ODBC,Conn_ODBC,1,3
RESPONSE.Write("ID      NAME<BR>")
RESPONSE.Write("————<BR>")
DO WHILE NOT RS_ODBC.EOF
RESPONSE.Write(RS_ODBC("ID")&"      "&RS_ODBC("NAME")&"<BR>")
RS_ODBC.MOVENEXT
LOOP
%>

日期比较

/*判断开始日期 结束日期*/    
sms_rate_start=document.form1.sms_rate_start.value;
sms_rate_end=document.form1.sms_rate_end.value;
    var beginD=sms_rate_start.split(" ");
var endD=sms_rate_end.split(" ");
var arr1=beginD[0].split("-");
var arr2=endD[0].split("-");
var arr3=beginD[1].split(":");
var arr4=endD[1].split(":");

var a1;
var a2;
try
{
    a1=new Date(arr1[0],arr1[1],arr1[2],arr3[0],arr3[1],arr3[2]);
    a2=new Date(arr2[0],arr2[1],arr2[2],arr4[0],arr4[1],arr4[2]);
      if(a1>a2)
      {
       //args.IsValid=false;//error window.alert("");
       alert("开始日期不能大于结束日期");
       return false;
      }                                       
     
}
catch(e)
{
    window.alert("请从控件中选取日期!");
    return false;
}

ASP数据库操作大全

<%
‘#######以下是一个类文件,下面的注解是调用类的方法################################################
‘# 注意:如果系统不支持建立Scripting.FileSystemObject对象,那么数据库压缩功能将无法使用
‘# Access 数据库类
‘# CreateDbFile 建立一个Access 数据库文件
‘# CompactDatabase 压缩一个Access 数据库文件
‘# 建立对象方法:
‘# Set a = New DatabaseTools
‘# by (萧寒雪) s.f.
‘#########################################################################################

Class DatabaseTools

Public function CreateDBfile(byVal dbFileName,byVal DbVer,byVal SavePath)
‘建立数据库文件
‘If DbVer is 0 Then Create Access97 dbFile
‘If DbVer is 1 Then Create Access2000 dbFile
On error resume Next
If Right(SavePath,1)<>"\" Or Right(SavePath,1)<>"/" Then SavePath = Trim(SavePath) & "\"
If Left(dbFileName,1)="\" Or Left(dbFileName,1)="/" Then dbFileName = Trim(Mid(dbFileName,2,Len(dbFileName)))
If DbExists(SavePath & dbFileName) Then
Response.Write ("对不起,该数据库已经存在!")
CreateDBfile = False
Else
Dim Ca
Set Ca = Server.CreateObject("ADOX.Catalog")
If Err.number<>0 Then
Response.Write ("无法建立,请检查错误信息
" & Err.number & "
" & Err.content:encoded)
Err.Clear
Exit function
End If
If DbVer=0 Then
call Ca.Create("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & SavePath & dbFileName)
Else
call Ca.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SavePath & dbFileName)
End If
Set Ca = Nothing
CreateDBfile = True
End If
End function

Public function CompactDatabase(byVal dbFileName,byVal DbVer,byVal SavePath)
‘压缩数据库文件
‘0 为access 97
‘1 为access 2000
On Error resume next
If Right(SavePath,1)<>"\" Or Right(SavePath,1)<>"/" Then SavePath = Trim(SavePath) & "\"
If Left(dbFileName,1)="\" Or Left(dbFileName,1)="/" Then dbFileName = Trim(Mid(dbFileName,2,Len(dbFileName)))
If DbExists(SavePath & dbFileName) Then
Response.Write ("对不起,该数据库已经存在!")
CompactDatabase = False
Else
Dim Cd
Set Cd =Server.CreateObject("JRO.JetEngine")
If Err.number<>0 Then
Response.Write ("无法压缩,请检查错误信息
" & Err.number & "
" & Err.content:encoded)
Err.Clear
Exit function
End If
If DbVer=0 Then
call Cd.CompactDatabase("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & SavePath & dbFileName,"Provider=Microsoft.Jet.OLEDB.3.51;Data
Source=" & SavePath & dbFileName & ".bak.mdb;Jet OLEDB;Encrypt Database=True")
Else
call Cd.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
SavePath & dbFileName,"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
SavePath & dbFileName & ".bak.mdb;Jet OLEDB;Encrypt Database=True")
End If
‘删除旧的数据库文件
call DeleteFile(SavePath & dbFileName)
‘将压缩后的数据库文件还原
call RenameFile(SavePath & dbFileName & ".bak.mdb",SavePath & dbFileName)
Set Cd = False
CompactDatabase = True
End If
end function

Public function DbExists(byVal dbPath)
‘查找数据库文件是否存在
On Error resume Next
Dim c
Set c = Server.CreateObject("ADODB.Connection")
c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath
If Err.number<>0 Then
Err.Clear
DbExists = false
else
DbExists = True
End If
set c = nothing
End function

Public function AppPath()
‘取当前真实路径
AppPath = Server.MapPath("./")
End function

Public function AppName()
‘取当前程序名称
AppName = Mid(Request.ServerVariables("SCRIPT_NAME"),(InStrRev(Request.ServerVariables("SCRIPT_NAME") ,"/",-1,1))+1,Len(Request.ServerVariables("SCRIPT_NAME")))
End Function

Public function DeleteFile(filespec)
‘删除一个文件
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If Err.number<>0 Then
Response.Write("删除文件发生错误!请查看错误信息
" & Err.number & "
" & Err.content:encoded)
Err.Clear
DeleteFile = False
End If
call fso.DeleteFile(filespec)
Set fso = Nothing
DeleteFile = True
End function

Public function RenameFile(filespec1,filespec2)
‘修改一个文件
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If Err.number<>0 Then
Response.Write("修改文件名时发生错误!请查看错误信息
" & Err.number & "
" & Err.content:encoded)
Err.Clear
RenameFile = False
End If
call fso.CopyFile(filespec1,filespec2,True)
call fso.DeleteFile(filespec1)
Set fso = Nothing
RenameFile = True
End function

End Class
%>

现在已可以压缩有密码的数据库,代码如下,但是压缩之后的数据库密码就没有了!如何解决?

<%
Const JET_3X = 4

Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")

If boolIs97 = "True" Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=’XXXXXXXX';Data Source=" & strDBPath & "temp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=’XXXXXXXX';Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
End If

fso.CopyFile strDBPath & "temp.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")
Set fso = nothing
Set Engine = nothing

CompactDB = "你的数据库, " & dbpath & ", 已经压缩成功!" & vbCrLf

Else
CompactDB = "数据库名称或路径不正确. 请重试!" & vbCrLf
End If

End Function
%>

ASP与Access数据库连接:
<%@ language=VBs cript%>
<%
dim conn,mdbfile
mdbfile=server.mappath("数据库名称.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=数据库密码;dbq="&mdbfile
%>

ASP与SQL数据库连接:
<%@ language=VBs cript%>
<%
dim conn
set conn=server.createobject("ADODB.connection")
con.open "PROVIDER=SQLOLEDB;DATA SOURCE=SQL服务器名称或IP地址;UID=sa;PWD=数据库密码;DATABASE=数据库名称
%>

建立记录集对象:
set rs=server.createobject("adodb.recordset")
rs.open SQL语句,conn,3,2

SQL常用命令使用方法:
(1) 数据记录筛选:
sql="select * from 数据表 where 字段名=字段值 order by 字段名 [desc]"
sql="select * from 数据表 where 字段名 like ‘%字段值%’ order by 字段名 [desc]"
sql="select top 10 * from 数据表 where 字段名 order by 字段名 [desc]"
sql="select * from 数据表 where 字段名 in (‘值1′,’值2′,’值3′)"
sql="select * from 数据表 where 字段名 between 值1 and 值2"
(2) 更新数据记录:
sql="update 数据表 set 字段名=字段值 where 条件表达式"
sql="update 数据表 set 字段1=值1,字段2=值2 …… 字段n=值n where 条件表达式"
(3) 删除数据记录:
sql="delete from 数据表 where 条件表达式"
sql="delete from 数据表" (将数据表所有记录删除)
(4) 添加数据记录:
sql="insert into 数据表 (字段1,字段2,字段3 …) valuess (值1,值2,值3 …)"
sql="insert into 目标数据表 select * from 源数据表" (把源数据表的记录添加到目标数据表)
(5) 数据记录统计函数:
AVG(字段名) 得出一个表格栏平均值
COUNT(*|字段名) 对数据行数的统计或对某一栏有值的数据行数统计
MAX(字段名) 取得一个表格栏最大的值
MIN(字段名) 取得一个表格栏最小的值
SUM(字段名) 把数据栏的值相加
引用以上函数的方法:
sql="select sum(字段名) as 别名 from 数据表 where 条件表达式"
set rs=conn.excute(sql)
用 rs("别名") 获取统的计值,其它函数运用同上。
(5) 数据表的建立和删除:
CREATE TABLE 数据表名称(字段1 类型1(长度),字段2 类型2(长度) …… )
例:CREATE TABLE tab01(name varchar(50),datetime default now())
DROP TABLE 数据表名称 (永久性删除一个数据表)

记录集对象的方法:
rs.movenext 将记录指针从当前的位置向下移一行
rs.moveprevious 将记录指针从当前的位置向上移一行
rs.movefirst 将记录指针移到数据表第一行
rs.movelast 将记录指针移到数据表最后一行
rs.absoluteposition=N 将记录指针移到数据表第N行
rs.absolutepage=N 将记录指针移到第N页的第一行
rs.pagesize=N 设置每页为N条记录
rs.pagecount 根据 pagesize 的设置返回总页数
rs.recordcount 返回记录总数
rs.bof 返回记录指针是否超出数据表首端,true表示是,false为否
rs.eof 返回记录指针是否超出数据表末端,true表示是,false为否
rs.delete 删除当前记录,但记录指针不会向下移动
rs.addnew 添加记录到数据表末端
rs.update 更新数据表记录

ASP统计图–柱形图 

<%@ codepage=65001%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!–#include file="conn.asp"–>
<%
nowtime=now()
nowtime1=DateAdd("m", -1, nowtime)
nowtime2=DateAdd("m", -2, nowtime)
nowtime3=DateAdd("m", -3, nowtime)
nowtime4=DateAdd("m", -4, nowtime)
nowtime5=DateAdd("m", -5, nowtime)
nowtime6=DateAdd("m", -6, nowtime)
nowtime7=DateAdd("m", -7, nowtime)
nowtime8=DateAdd("m", -8, nowtime)
nowtime9=DateAdd("m", -9, nowtime)
nowtime10=DateAdd("m", -10, nowtime)
nowtime11=DateAdd("m", -11, nowtime)
nowtime12=DateAdd("m", -12, nowtime)

thisDay = day(nowtime)
thisMonth = month(nowtime)
thisYear = year(nowtime)

thisDay1 = day(nowtime1)
thisMonth1 = month(nowtime1)
thisYear1 = year(nowtime1)

thisDay2 = day(nowtime2)
thisMonth2 = month(nowtime2)
thisYear2 = year(nowtime2)

thisDay2 = day(nowtime2)
thisMonth2 = month(nowtime2)
thisYear2 = year(nowtime2)

thisDay3 = day(nowtime3)
thisMonth3 = month(nowtime3)
thisYear3 = year(nowtime3)

thisDay4 = day(nowtime4)
thisMonth4 = month(nowtime4)
thisYear4 = year(nowtime4)

thisDay5 = day(nowtime5)
thisMonth5 = month(nowtime5)
thisYear5 = year(nowtime5)

thisDay6 = day(nowtime6)
thisMonth6 = month(nowtime6)
thisYear6 = year(nowtime6)

thisDay7 = day(nowtime7)
thisMonth7 = month(nowtime7)
thisYear7 = year(nowtime7)

thisDay8 = day(nowtime8)
thisMonth8 = month(nowtime8)
thisYear8 = year(nowtime8)

thisDay9 = day(nowtime9)
thisMonth9 = month(nowtime9)
thisYear9 = year(nowtime9)

thisDay10 = day(nowtime10)
thisMonth10 = month(nowtime10)
thisYear10 = year(nowtime10)

thisDay11 = day(nowtime11)
thisMonth11 = month(nowtime11)
thisYear11 = year(nowtime11)

thisDay12 = day(nowtime12)
thisMonth12 = month(nowtime12)
thisYear12 = year(nowtime12)

call openDB()

set rs1= Server.CreateObject("adodb.recordset")
sql1="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear&" and month(dataandtime)="&thisMonth&" and why=’銀行のチャージ’"
rs1.open sql1,conn,3,3
number1=CLNG(rs1("SUMMONEY"))

set rs2= Server.CreateObject("adodb.recordset")
sql2="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear1&" and month(dataandtime)="&thisMonth1&" and why=’銀行のチャージ’"
rs2.open sql2,conn,3,3
number2=CLNG(rs2("SUMMONEY"))

set rs3= Server.CreateObject("adodb.recordset")
sql3="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear2&" and month(dataandtime)="&thisMonth2&" and why=’銀行のチャージ’"
rs3.open sql3,conn,3,3
number3=CLNG(rs3("SUMMONEY"))

set rs4= Server.CreateObject("adodb.recordset")
sql4="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear3&" and month(dataandtime)="&thisMonth3&" and why=’銀行のチャージ’"
rs4.open sql4,conn,3,3
number4=CLNG(rs4("SUMMONEY"))

set rs5= Server.CreateObject("adodb.recordset")
sql5="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear4&" and month(dataandtime)="&thisMonth4&" and why=’銀行のチャージ’"
rs5.open sql5,conn,3,3
number5=CLNG(rs5("SUMMONEY"))

set rs6= Server.CreateObject("adodb.recordset")
sql6="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear5&" and month(dataandtime)="&thisMonth5&" and why=’銀行のチャージ’"
rs6.open sql6,conn,3,3
number6=CLNG(rs6("SUMMONEY"))

set rs7= Server.CreateObject("adodb.recordset")
sql7="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear6&" and month(dataandtime)="&thisMonth6&" and why=’銀行のチャージ’"
rs7.open sql7,conn,3,3
number7=CLNG(rs7("SUMMONEY"))

set rs8= Server.CreateObject("adodb.recordset")
sql8="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear7&" and month(dataandtime)="&thisMonth7&" and why=’銀行のチャージ’"
rs8.open sql8,conn,3,3
number8=CLNG(rs8("SUMMONEY"))

set rs9= Server.CreateObject("adodb.recordset")
sql9="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear8&" and month(dataandtime)="&thisMonth8&" and why=’銀行のチャージ’"
rs9.open sql9,conn,3,3
number9=CLNG(rs9("SUMMONEY"))

set rs10= Server.CreateObject("adodb.recordset")
sql10="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear9&" and month(dataandtime)="&thisMonth9&" and why=’銀行のチャージ’"
rs10.open sql10,conn,3,3
number10=CLNG(rs10("SUMMONEY"))

set rs11= Server.CreateObject("adodb.recordset")
sql11="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear10&" and month(dataandtime)="&thisMonth10&" and why=’銀行のチャージ’"
rs11.open sql11,conn,3,3
number11=CLNG(rs11("SUMMONEY"))

set rs12= Server.CreateObject("adodb.recordset")
sql12="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear11&" and month(dataandtime)="&thisMonth11&" and why=’銀行のチャージ’"
rs12.open sql12,conn,3,3
number12=CLNG(rs12("SUMMONEY"))

set rs13= Server.CreateObject("adodb.recordset")
sql13="select SUM(how) AS SUMMONEY from record where how>=0 and year(dataandtime)="&thisYear12&" and month(dataandtime)="&thisMonth12&" and why=’銀行のチャージ’"
rs13.open sql13,conn,3,3
number13=CLNG(rs13("SUMMONEY"))

  
‘参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,X轴单位,Y轴单位)  
function   table1(stat_array,table_left,table_top,all_width,all_height,table_title,X_unit,Y_unit)  
dim   bg_color(13)  
bg_color(1)="#ff1919"  
bg_color(2)="#ffff19"  
bg_color(3)="#1919ff"  
bg_color(4)="#19ff19"  
bg_color(5)="#fc0"  
bg_color(6)="#3cc"  
bg_color(7)="#ff19ff"  
bg_color(8)="#993300"  
bg_color(9)="#f60"  
bg_color(10)="#ffff19"
bg_color(11)="#19ff19"  
bg_color(12)="#ff1919"
bg_color(13)="#19ff19"

   
if   X_unit<>""   then  
X_unit=X_unit  
end   if  
if   Y_unit<>""   then  
Y_unit=Y_unit  
end   if  
   
num   =ubound(stat_array,1)  
item_width   =   cint(20000/num+0.5)  
begin_x=   cint((item_width-1200)/2)+2200  
   
value_Max=0  
for   i=1   to   num  
if   value_Max<stat_array(i,1)   then   value_Max=stat_array(i,1)  
next  
value_Max   =   clng(value_Max)  
value_Max_str   =cstr(value_Max)    
if   value_Max>9   then  
temp=mid(value_Max_str,2,1)  
if   temp>4   then    
temp2=(int(value_Max/(10^(len(value_Max_str)-1)))+1)*10^(len(value_Max_str)-1)  
else  
temp2=(int(value_Max/(10^(len(value_Max_str)-1)))+0.5)*10^(len(value_Max_str)-1)  
end   if  
else  
if   value_Max>4   then   temp2=10   else   temp2=5  
end   if  
item_hight   =   temp2/5  
‘下一句改变柱状体的3d模式  
response.Write   "<v:shapetype   id=’Box’   coordsize=’21600,21600′   o:spt=’16’   adj=’5400′></v:shapetype>"  
   
‘绘制灰色背景  
response.Write   "<v:rect   id=’background’   style=’position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;’   fillcolor=’#EFEFEF’   strokecolor=’gray’>"  
response.Write   "   <v:shadow   on=’t’   type=’single’   color=’silver’   offset=’4pt,4pt’/>"  
response.Write   "</v:rect>"  
‘绘制图的主体  
response.Write   "<v:group   ID=’table’   style=’position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;’   coordsize   =   ‘23500,12700’>"    
‘绘制标题层  
response.Write   "   <v:Rect   style=’position:relative;left:1500;top:200;width:20000;height:800’filled=’false’   stroked=’false’>"  
response.Write   "   <v:TextBox   inset=’0pt,0pt,0pt,0pt’>"  
response.Write   "   <table   width=’100%’   border=’0′   align=’center’   cellspacing=’0′>"  
response.Write   "   <tr>"  
response.Write   "   <td   align=’center’   valign=’middle’><div   style=’font-size:15pt;   font-family:黑体;’><B>"&table_title&"</B></div></td>"  
response.Write   "   </tr>"  
response.Write   "   </table>"  
response.Write   "   </v:TextBox>"  
response.Write   "   </v:Rect>   "  
‘绘制图表主体的蓝色渐变背景  
response.Write   "   <v:rect   id=’back’   style=’position:relative;left:1700;top:1200;width:20500;   height:10500;’   fillcolor=’#9cf’   strokecolor=’#DFDFDF’>"  
response.Write   "   <v:fill   rotate=’t’   angle=’-45′   focus=’100%’   type=’gradient’/>"  
response.Write   "   </v:rect>"  
‘横坐标轴  
response.Write   "   <v:line   ID=’X’   from=’1700,11700′   to=’22700,11700′   style=’z-index:2′   strokecolor=’#000000′   strokeWeight=1pt><v:stroke   EndArrow=’Classic’/></v:line>"  
‘纵坐标轴  
response.Write   "   <v:line   ID=’Y’   from=’1700,900′   to=’1700,11700′   style=’z-index:2′   strokecolor=’#000000′   strokeWeight=1pt><v:stroke   StartArrow=’Classic’/></v:line>"  
‘写x、y轴单位  
response.Write   "   <v:Rect   style=’position:relative;left:100;top:700;width:1500;height:500′   filled=’false’   stroked=’false’>"  
response.Write   "   <v:TextBox   inset=’0pt,0pt,0pt,0pt’   style=’font-size:9pt;’><div   align=’right’>"&Y_unit&"</div></v:TextBox>"  
response.Write   "   </v:Rect>   "    
response.Write   "   <v:Rect   style=’position:relative;left:22200;top:11700;width:2000;height:500′   filled=’false’   stroked=’false’>"  
response.Write   "   <v:TextBox   inset=’0pt,0pt,0pt,0pt’   style=’font-size:9pt;’><div   align=’left’>"&X_unit&"</div></v:TextBox>"  
response.Write   "   </v:Rect>   "    
‘4根纵坐标校准线  
for   i=0   to   4  
response.Write   "   <v:line   from=’1200,"&i*2000+1700&"’   to=’1700,"&i*2000+1700&"’   style=’z-index:2′   strokecolor=’#000000′></v:line>"  
response.Write   "   <v:line   from=’1700,"&i*2000+1700&"’   to=’2200,"&i*2000+1200&"’   style=’z-index:2′   strokecolor=’#0099FF’></v:line>"  
response.Write   "   <v:line   from=’2200,"&i*2000+1200&"’   to=’22200,"&i*2000+1200&"’   style=’z-index:2′   strokecolor=’#0099FF’></v:line>"  
response.Write   "   <v:line   from=’2200,"&i*2000+2200&"’   to=’22200,"&i*2000+2200&"’   style=’z-index:2′   strokecolor=’#0099FF’>"  
response.Write   "   <v:stroke   dashstyle=’Dot’/>"  
response.Write   "   </v:line>"  
‘写y轴刻度  
response.Write   "   <v:Rect   style=’position:relative;left:100;top:"&i*2000+1250&";width:1500;height:500′   filled=’false’   stroked=’false’>"  
response.Write   "   <v:TextBox   inset=’0pt,0pt,0pt,0pt’   style=’font-size:9pt;’><div   align=’right’>"&item_hight*(5-i)&"</div></v:TextBox>"  
response.Write   "   </v:Rect>   "    
next  
‘3根坐标轴基准线x,y,z  
response.Write   "   <v:line   from=’2200,11200′   to=’22200,11200′   style=’z-index:2′   strokecolor=’#0099FF’></v:line>"  
response.Write   "   <v:line   from=’2200,1200′   to=’2200,11200′   style=’z-index:2′   strokecolor=’#0099FF’></v:line>"  
response.Write   "   <v:line   from=’1700,11700′   to=’2200,11200′   style=’z-index:2′   strokecolor=’#0099FF’></v:line>"  
‘写柱子  
for   i=1   to   num  
this_hight   =   cint(stat_array(i,1)/(5*item_hight)*10000+420)  
response.Write   "   <v:shape   id=’Box"&i&"’   type=’#Box’   fillcolor=’"&bg_color(i)&"’   strokecolor=’#5f5f5f’   style=’position:relative;   left:"&(i-1)*item_width+begin_x&";top:"&cint(10000-this_hight+1620)&";width:1200;height:"&this_hight&";z-index:10′>"  
response.Write   "   <v:fill   o:opacity2=’52429f’   rotate=’t’   angle=’-45′   focus=’100%’   type=’gradient’/>"  
response.Write   "   </v:shape>"  
   
response.Write   "   <v:Rect   style=’position:relative;left:"&(i-1)*item_width+2200&";top:"&cint(10000-this_hight+1150)&";width:"&item_width&";height:500′   filled=’false’   stroked=’false’>"  
response.Write   "   <v:TextBox   inset=’0pt,0pt,0pt,0pt’   style=’font-size:9pt;’><div   align=’center’>"&stat_array(i,1)&"</div></v:TextBox>"  
response.Write   "   </v:Rect>   "    
   
response.Write   "   <v:Rect   style=’position:relative;left:"&(i-1)*item_width+2200&";top:11850;width:"&item_width&";height:500′   filled=’false’   stroked=’false’>"  
response.Write   "   <v:TextBox   inset=’0pt,0pt,0pt,0pt’   style=’font-size:9pt;’><div   align=’center’>"&stat_array(i,2)&"</div></v:TextBox>"  
response.Write   "   </v:Rect>   "    
next  
response.Write   "</v:group>"  
end   function  
%>  
<html   xmlns:v="urn:schemas-microsoft-com:vml"   xmlns:o="urn:schemas-microsoft-com:office:office">  
<head>  
<title>
</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">
<STYLE>  
v\:*   {   Behavior:   url(#default#VML)   }  
o\:*   {   behavior:   url(#default#VML)   }  
</STYLE>  
</head>  
<body>  
<%  
dim   total(13,2)
total(1,1)=number13
total(2,1)=number12
total(3,1)=number11
total(4,1)=number10
total(5,1)=number9  
total(6,1)=number8
total(7,1)=number7  
total(8,1)=number6  
total(9,1)=number5  
total(10,1)=number4  
total(11,1)=number3
total(12,1)=number2
total(13,1)=number1
   
total(1,2)="一年前"
total(2,2)="前11个月"  
total(3,2)="前10个月"  
total(4,2)="前9个月"  
total(5,2)="前8个月"  
total(6,2)="前7个月"  
total(7,2)="前6个月"  
total(8,2)="前5个月"  
total(9,2)="前4个月"  
total(10,2)="前3个月"  
total(11,2)="前2个月"  
total(12,2)="前1个月"  
total(13,2)="当前月"
   
call   table1(total,20,20,750,400,"Bitcash充值统计图","","日元")  
%>  
</body>  
</html>

ASP统计图–曲线图

<%
‘┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
‘┃                               ┃
‘┃ 摘 要: 统计图–曲线图                    ┃
‘┃ 作 者: 翁云兵                       ┃
‘┃ 创建日期:2004年12月01日                   ┃
‘┃ 完成日期:2004年11月03日                   ┃
‘┃                               ┃
‘┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
‘参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,X轴单位,Y轴单位)
function table1(stat_array,table_left,table_top,all_width,all_height,table_title,X_unit,Y_unit)
dim bg_color(10)
bg_color(1)="#ff1919"
bg_color(2)="#ffff19"
bg_color(3)="#1919ff"
bg_color(4)="#19ff19"
bg_color(5)="#fc0"
bg_color(6)="#3cc"
bg_color(7)="#ff19ff"
bg_color(8)="#993300"
bg_color(9)="#f60"
bg_color(10)="#ff8c19"

if X_unit <> "" then
X_unit = X_unit
end if
if Y_unit <> "" then
Y_unit = Y_unit
end if

num1 = ubound(stat_array,1)
line_temp=split(stat_array(0,1),",")
num2 = ubound(line_temp,1)+1
dim line_code
redim line_code(num1,num2)
for j=1 to num2
line_code(0,j) = line_temp(j-1)
next
for i=1 to num1
line_temp = split(stat_array(i,1),",")
line_code(i,0) = stat_array(i,2)
for j=1 to num2
line_code(i,j) = cdbl(line_temp(j-1))
next
next
value_Max=0
for i=1 to num1
for j=1 to num2
if value_Max<line_code(i,j) then value_Max=line_code(i,j)
next
next

value_Max = cint(value_Max)
value_Max_str =cstr(value_Max)
if value_Max>9 then
temp=mid(value_Max_str,2,1)
if temp>4 then
temp2=(int(value_Max/(10^(len(value_Max_str)-1)))+1)*10^(len(value_Max_str)-1)
else
temp2=(int(value_Max/(10^(len(value_Max_str)-1)))+0.5)*10^(len(value_Max_str)-1)
end if
else
if value_Max>4 then temp2=10 else temp2=5
end if
item_hight = temp2/5

item_width = 20000/(num2-1)

response.Write "<v:rect id=’background’ style=’position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;’ fillcolor=’#EFEFEF’ strokecolor=’gray’>"
response.Write " <v:shadow on=’t’ type=’single’ color=’silver’ offset=’4pt,4pt’/>"
response.Write "</v:rect>"

response.Write "<v:group ID=’table’ style=’position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;’ coordsize = ‘27500,12800’>"

response.Write " <v:Rect style=’position:relative;left:1500;top:200;width:23000;height:800’filled=’false’ stroked=’f’>"
response.Write " <v:TextBox inset=’0pt,0pt,0pt,0pt’>"
response.Write " <table width=’100%’ border=’0′ align=’center’ cellspacing=’0′>"
response.Write " <tr>"
response.Write " <td align=’center’ valign=’middle’><div style=’font-size:15pt; font-family:黑体;’><B>"&table_title&"</B></div></td>"
response.Write " </tr>"
response.Write " </table>"
response.Write " </v:TextBox>"
response.Write " </v:Rect> "

response.Write " <v:rect id=’back’ style=’position:relative;left:1700;top:1200;width:20500; height:10500;’ fillcolor=’#9cf’ strokecolor=’#DFDFDF’>"
response.Write " <v:fill rotate=’t’ angle=’-45′ focus=’100%’ type=’gradient’/>"
response.Write " </v:rect>"

response.Write " <v:rect id=’back2′ style=’position:relative;left:23000;top:1200;width:4000; height:"&(10500)&";’ fillcolor=’#9cf’ stroked=’t’ strokecolor=’#0099ff’>"
response.Write " <v:fill rotate=’t’ angle=’-175′ focus=’100%’ type=’gradient’/>"
response.Write " <v:shadow on=’t’ type=’single’ color=’silver’ offset=’3pt,3pt’/>"
response.Write " </v:rect>"

for i=1 to num1
if i=1 then
displaystr=""
else
displaystr="none"
end if
response.Write " <div style=’cursor:hand;’ onmouseover=’moveon(rec"&i&",line_"&i&")’ onmouseout=’moveout(rec"&i&",line_"&i&","&i&")’ onclick=’clickit("&i&")’>"
response.Write " <v:Rect id=’rec"&i&"’ style=’position:relative;left:23100;top:"&(i-1)*10200/10+1450&";width:3800;height:800;display:"&displaystr&";’ fillcolor=’#efefef’ strokecolor=’"&bg_color(i)&"’>"
response.Write " <v:fill opacity=’.6′ color2=’fill darken(118)’ o:opacity2=’.6′ rotate=’t’ method=’linear sigma’ focus=’100%’ type=’gradient’/>"
response.Write " </v:Rect>"
response.Write " <v:Rect style=’position:relative;left:23200;top:"&(i-1)*10200/10+1500&";width:600;height:700′ fillcolor=’"&bg_color(i)&"’ stroked=’f’/>"
response.Write " <v:Rect style=’position:relative;left:24000;top:"&(i-1)*10200/10+1500&";width:3400;height:700′ filled=’f’ stroked=’f’>"
response.Write " <v:TextBox inset=’0pt,4pt,0pt,0pt’ style=’font-size:9pt;’><div align=’left’>"&stat_array(i,2)&"</div></v:TextBox>"
response.Write " </v:Rect> "
response.Write " </div> "
next

response.Write " <v:line ID=’X’ from=’1700,11700′ to=’22700,11700′ style=’z-index:2′ strokecolor=’#000000′ strokeWeight=1pt><v:stroke EndArrow=’Classic’/></v:line>"
response.Write " <v:line ID=’Y’ from=’1700,900′ to=’1700,11700′ style=’z-index:2′ strokecolor=’#000000′ strokeWeight=1pt><v:stroke StartArrow=’Classic’/></v:line>"

response.Write " <v:Rect style=’position:relative;left:100;top:700;width:1500;height:500′ filled=’false’ stroked=’false’>"
response.Write " <v:TextBox inset=’0pt,0pt,0pt,0pt’ style=’font-size:9pt;’><div align=’right’>"&Y_unit&"</div></v:TextBox>"
response.Write " </v:Rect> "
response.Write " <v:Rect style=’position:relative;left:22200;top:11900;width:2000;height:500′ filled=’false’ stroked=’false’>"
response.Write " <v:TextBox inset=’0pt,0pt,0pt,0pt’ style=’font-size:9pt;’><div align=’left’>"&X_unit&"</div></v:TextBox>"
response.Write " </v:Rect> "

for i=0 to 4
response.Write " <v:line from=’1300,"&i*2000+1700&"’ to=’1700,"&i*2000+1700&"’ style=’z-index:2′ strokecolor=’#000000′></v:line>"
response.Write " <v:line from=’1700,"&i*2000+1700&"’ to=’2200,"&i*2000+1200&"’ style=’z-index:2′ strokecolor=’#0099FF’></v:line>"
response.Write " <v:line from=’2200,"&i*2000+1200&"’ to=’22200,"&i*2000+1200&"’ style=’z-index:2′ strokecolor=’#0099FF’></v:line>"
response.Write " <v:line from=’2200,"&i*2000+2200&"’ to=’22200,"&i*2000+2200&"’ style=’z-index:2′ strokecolor=’#0099FF’>"
response.Write " <v:stroke dashstyle=’Dot’/>"
response.Write " </v:line>"

response.Write " <v:Rect style=’position:relative;left:100;top:"&i*2000+1250&";width:1500;height:500′ filled=’false’ stroked=’false’>"
response.Write " <v:TextBox inset=’0pt,0pt,0pt,0pt’ style=’font-size:9pt;’><div align=’right’>"&item_hight*(5-i)&"</div></v:TextBox>"
response.Write " </v:Rect> "
next

response.Write " <v:line from=’2200,11200′ to=’22200,11200′ style=’z-index:2′ strokecolor=’#0099FF’></v:line>"
response.Write " <v:line from=’2200,1200′ to=’2200,11200′ style=’z-index:2′ strokecolor=’#0099FF’></v:line>"
response.Write " <v:line from=’1700,11700′ to=’2200,11200′ style=’z-index:2′ strokecolor=’#0099FF’></v:line>"

for j=0 to num2-1
response.Write " <v:line from=’"&j*item_width+1700&",11700′ to=’"&j*item_width+1700&",12000′ style=’z-index:2′ strokecolor=’#000000′></v:line>"
response.Write " <v:line from=’"&j*item_width+1700&",11700′ to=’"&j*item_width+2200&",11200′ style=’z-index:2′ strokecolor=’#0099FF’><v:stroke dashstyle=’ShortDot’/></v:line>"
response.Write " <v:line from=’"&j*item_width+2200&",1200′ to=’"&j*item_width+2200&",11200′ style=’z-index:2′ strokecolor=’#0099FF’><v:stroke dashstyle=’ShortDot’/></v:line>"
response.Write " <v:Rect style=’position:relative;left:"&j*item_width+1700-item_width/2&";top:12100;width:"&item_width&";height:500′ filled=’false’ stroked=’false’>"
response.Write " <v:TextBox inset=’0pt,0pt,0pt,0pt’ style=’font-size:9pt;’><div align=’center’>"&line_code(0,j+1)&"</div></v:TextBox>"
response.Write " </v:Rect> "
next
for i=1 to num1
if i=1 then
displaystr=""
else
displaystr="none"
end if
response.Write " <div id=’line_"&i&"’ style=’display:"&displaystr&";’>"
for j=0 to num2-2
this_hight1 = cint(line_code(i,j+1)/(5*item_hight)*10000)
this_hight2 = cint(line_code(i,j+2)/(5*item_hight)*10000)
response.Write " <v:line from=’"&j*item_width+1850&","&(10000-this_hight1+1550)&"’ to=’"&(j+1)*item_width+1850&","&(10000-this_hight2+1550)&"’style=’z-index:"&i*10&";’ strokeweight=’0.1pt’ strokecolor=’"&bg_color(i)&"’>"
response.Write " <o:extrusion v:ext=’view’ backdepth=’12pt’ on=’t’ lightposition=’-50000,-50000′ lightposition2=’50000’/>"
response.Write " </v:line>"
next
response.Write " </div>"
next

response.Write "</v:group>"
end function
%>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
<STYLE>
v\:* { Behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!–
var showit = new Array(10);

function moveon(iteam,lineit){
temp=eval(iteam)
templine=eval(lineit)
if(showit[1]){
rec1.style.display = "";
line_1.style.display = "";
}else{
rec1.style.display = "none";
line_1.style.display = "none";
}
temp.style.display = "";
templine.style.display = "";
}
function moveout(iteam,lineit,i){
temp=eval(iteam)
templine=eval(lineit)
if (showit[i]){
temp.style.display = "";
templine.style.display = "";
}else{
temp.style.display = "none";
templine.style.display = "none";
}
}
function clickit(i){
if (showit[i]){
showit[i]=false
}else{
showit[i]=true
}
}
–>
</script>
</head>
<body>

<%
dim total(10,2)

total(0,1)="1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月"
total(1,1)="200,158,982,0,369,100,595,895,652,25,245,951"
total(2,1)="984,58,495,36,158,486,952,258,653,415,485,14"
total(3,1)="850,988,958,145,369,745,265,158,856,145,425,352"
total(4,1)="600,525,235,485,258,265,158,365,35,148,658,475"
total(5,1)="62,525,635,215,0,465,258,305,66,547,54,148"
total(6,1)="560,625,645,329,158,665,358,95,120,358,42,253"
total(7,1)="950,725,635,435,258,865,458,955,152,845,425,421"
total(8,1)="600,825,155,455,458,265,558,365,352,245,853,122"
total(9,1)="360,925,215,545,658,465,658,845,400,421,541,125"
total(10,1)="50,225,355,655,858,665,758,35,584,214,54,651"

total(1,2)="项目1"
total(2,2)="项目2"
total(3,2)="项目3"
total(4,2)="项目4"
total(5,2)="项目5"
total(6,2)="项目6"
total(7,2)="项目7"
total(8,2)="项目8"
total(9,2)="项目9"
total(10,2)="项目10"

call table1(total,240,200,700,350,"曲 线 统 计 图","时间","元")
%>

</body>
</html>

ASP统计图–饼图 

<%@ codepage=65001%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
‘┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
‘┃                               ┃
‘┃ 摘 要: 统计图–饼图                     ┃
‘┃ 作 者: 翁云兵                       ┃
‘┃ 创建日期:2004年11月23日                   ┃
‘┃ 完成日期:2004年11月28日                   ┃
‘┃                               ┃
‘┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
‘参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)
function table2(stat_array,table_left,table_top,all_width,all_height,table_title,unit)
dim bg_color(10),pie(10)
bg_color(1)="#ff1919"
bg_color(2)="#ffff19"
bg_color(3)="#1919ff"
bg_color(4)="#19ff19"
bg_color(5)="#fc0"
bg_color(6)="#3cc"
bg_color(7)="#ff19ff"
bg_color(8)="#993300"
bg_color(9)="#f60"
bg_color(10)="#ff8c19"

num =ubound(stat_array,1)
allvalues=0
for i=1 to num
allvalues = allvalues+stat_array(i,1)
next
k=0
for i=1 to num-1
pie(i)=formatnumber(stat_array(i,1)/allvalues,4,-1)
k=k+pie(i)
next
pie(num)=formatnumber((1-k),4,-1)

response.Write "<v:shapetype id=’Cake_3D’ coordsize=’21600,21600′ o:spt=’95’ adj=’11796480,5400′ path=’al10800,10800@0@0@2@14,10800,10800,10800,10800@3@15xe’></v:shapetype>"

response.Write "<v:shapetype id=’3dtxt’ coordsize=’21600,21600′ o:spt=’136′ adj=’10800′ path=’m@7,l@8,m@5,21600l@6,21600e’> "
response.Write " <v:path textpathok=’t’ o:connecttype=’custom’ o:connectlocs=’@9,0;@10,10800;@11,21600;@12,10800′ o:connectangles=’270,180,90,0’/>"
response.Write " <v:textpath on=’t’ fitshape=’t’/>"
response.Write " <o:lock v:ext=’edit’ text=’t’ shapetype=’t’/>"
response.Write "</v:shapetype>"

response.Write "<v:rect id=’background’ style=’position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;’ fillcolor=’#EFEFEF’ strokecolor=’gray’>"
response.Write " <v:shadow on=’t’ type=’single’ color=’silver’ offset=’4pt,4pt’/>"
response.Write "</v:rect>"

response.Write "<v:group ID=’table’ style=’position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;’ coordsize = ‘21000,11500’>"
response.Write " <v:Rect style=’position:relative;left:500;top:200;width:20000;height:800’filled=’false’ stroked=’false’>"
response.Write " <v:TextBox inset=’0pt,0pt,0pt,0pt’>"
response.Write " <table width=’100%’ border=’0′ align=’center’ cellspacing=’0′>"
response.Write " <tr>"
response.Write " <td align=’center’ valign=’middle’><div style=’font-size:15pt; font-family:黑体;’><B>"&table_title&"</B></div></td>"
response.Write " </tr>"
response.Write " </table>"
response.Write " </v:TextBox>"
response.Write " </v:Rect> "

response.Write " <v:rect id=’back’ style=’position:relative;left:500;top:1000;width:20000; height:10000;’ onmouseover=’movereset(1)’ onmouseout=’movereset(0)’ fillcolor=’#9cf’ strokecolor=’#888888′>"
response.Write " <v:fill rotate=’t’ angle=’-45′ focus=’100%’ type=’gradient’/>"
response.Write " </v:rect>"

response.Write " <v:rect id=’back’ style=’position:relative;left:15000;top:1400;width:5000; height:"&((num+1)*9000/11+200)&";’ fillcolor=’#9cf’ stroked=’t’ strokecolor=’#0099ff’>"
response.Write " <v:fill rotate=’t’ angle=’-175′ focus=’100%’ type=’gradient’/>"
response.Write " <v:shadow on=’t’ type=’single’ color=’silver’ offset=’3pt,3pt’/>"
response.Write " </v:rect>"

response.Write " <v:Rect style=’position:relative;left:15500;top:1500;width:4000;height:700′ fillcolor=’#000000′ stroked=’f’ strokecolor=’#000000′>"
response.Write " <v:TextBox inset=’8pt,4pt,3pt,3pt’ style=’font-size:11pt;’><div align=’left’><font color=’#ffffff’><B>总数:"&allvalues&unit&"</B></font></div></v:TextBox>"
response.Write " </v:Rect> "
for i=1 to num
response.Write " <v:Rect id=’rec"&i&"’ style=’position:relative;left:15400;top:"&i*9000/11+1450&";width:4300;height:800;display:none’ fillcolor=’#efefef’ strokecolor=’"&bg_color(i)&"’>"
response.Write " <v:fill opacity=’.6′ color2=’fill darken(118)’ o:opacity2=’.6′ rotate=’t’ method=’linear sigma’ focus=’100%’ type=’gradient’/>"
response.Write " </v:Rect>"
response.Write " <v:Rect style=’position:relative;left:15500;top:"&i*9000/11+1500&";width:600;height:700′ fillcolor=’"&bg_color(i)&"’ stroked=’f’/>"
response.Write " <v:Rect style=’position:relative;left:16300;top:"&i*9000/11+1500&";width:3400;height:700′ filled=’f’ stroked=’f’>"
response.Write " <v:TextBox inset=’0pt,5pt,0pt,0pt’ style=’font-size:9pt;’><div align=’left’>"&stat_array(i,2)&":"&stat_array(i,1)&unit&"</div></v:TextBox>"
response.Write " </v:Rect> "
next

response.Write "</v:group>"

k1=180
k4=10
for i=1 to num
k2=360*pie(i)/2
k3=k1+k2
if k3>=360 then
k3=k3-360
end if
kkk=(-11796480*pie(i)+5898240)

k5=3.1414926*2*(180-(k3-180))/360
R=all_height/2
txt_x = table_left+all_height/8-30+R+R*sin(k5)*0.7
txt_y = table_top+all_height/14-39+R+R*cos(k5)*0.7*0.5

titlestr = "&nbsp;名&nbsp;&nbsp;称:"&stat_array(i,2)&"&#13;&#10;&nbsp;数&nbsp;&nbsp;值:"&stat_array(i,1)&unit&"&#13;&#10;&nbsp;所占比例:"&pie(i)*100&"%&nbsp;&nbsp;"
response.Write " <div style=’cursor:hand;’>"
response.Write " <v:shape id=’cake"&i&"’ type=’#Cake_3D’ title=’"&titlestr&"’"
response.Write " style=’position:absolute;left:"&table_left+all_height/8&"px;top:"&table_top+all_height/14&"px;WIDTH:"&all_height&"px;HEIGHT:"&all_height&"px;rotation:"&k3&";z-index:"&k4&"’"
response.Write " adj=’"&kkk&",0′ fillcolor=’"&bg_color(i)&"’ onmouseover=’moveup(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")'; onmouseout=’movedown(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&");’>"
response.Write " <v:fill opacity=’60293f’ color2=’fill lighten(120)’ o:opacity2=’60293f’ rotate=’t’ angle=’-135′ method=’linear sigma’ focus=’100%’ type=’gradient’/>"
response.Write " <o:extrusion v:ext=’view’ on=’t’backdepth=’25’ rotationangle=’60’ viewpoint=’0,0’viewpointorigin=’0,0′ skewamt=’0′ lightposition=’-50000,-50000′ lightposition2=’50000’/>"
response.Write " </v:shape>"
response.Write " <v:shape id=’txt"&i&"’ type=’#3dtxt’ style=’position:absolute;left:"&txt_x&"px;top:"&txt_y&"px;z-index:20;display:none;width:50; height:18;’ fillcolor=’#ffffff’"
response.Write " onmouseover=’ontxt(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")’>"
response.Write " <v:fill opacity=’60293f’ color2=’fill lighten(120)’ o:opacity2=’60293f’ rotate=’t’ angle=’-135′ method=’linear sigma’ focus=’100%’ type=’gradient’/>"
response.Write " <v:textpath style=’font-family:’宋体';v-text-kern:t’ trim=’t’ fitpath=’t’ string=’"&pie(i)*100&"%’/>"
response.Write " <o:extrusion v:ext=’view’ backdepth=’8pt’ on=’t’ lightposition=’0,0′ lightposition2=’0,0’/>"
response.Write " </v:shape>"
response.Write " </div>"
k1=k1+k2*2
if k1>=360 then
k1=k1-360
end if
if k1>180 then
k4=k4+1
else
k4=k4-1
end if
next
end function
%>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
<STYLE>
v\:* { Behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
</STYLE>
</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
<!–
onit=true
num=0
function moveup(iteam,top,txt,rec){
temp=eval(iteam)
tempat=eval(top)
temptxt=eval(txt)
temprec=eval(rec)
at=parseInt(temp.style.top)
temprec.style.display = "";
if (num>27){
temptxt.style.display = "";
}
if(at>(tempat-28)&&onit){
num++
temp.style.top=at-1
Stop=setTimeout("moveup(temp,tempat,temptxt,temprec)",10)
}else{
return
}
}
function movedown(iteam,top,txt,rec){
temp=eval(iteam)
temptxt=eval(txt)
temprec=eval(rec)
clearTimeout(Stop)
temp.style.top=top
num=0
temptxt.style.display = "none";
temprec.style.display = "none";
}
function ontxt(iteam,top,txt,rec){
temp = eval(iteam);
temptxt = eval(txt);
temprec = eval(rec)
if (onit){
temp.style.top = top-28;
temptxt.style.display = "";
temprec.style.display = "";
}
}
function movereset(over){
if (over==1){
onit=false
}else{
onit=true
}
}
–>
</script>
<%
dim total(10,2)

total(1,1)=2000
total(2,1)=1800
total(3,1)=1700
total(4,1)=1500
total(5,1)=1222
total(6,1)=1100
total(7,1)=1000
total(8,1)=800
total(9,1)=700
total(10,1)=600

total(1,2)="项目1"
total(2,2)="项目2"
total(3,2)="项目3"
total(4,2)="项目4"
total(5,2)="项目5"
total(6,2)="项目6"
total(7,2)="项目7"
total(8,2)="项目8"
total(9,2)="项目9"
total(10,2)="项目10"

call table2(total,240,200,700,400,"三维饼状图","元")
%>
</body>
</html>


asp md5加密

<%
””””””””””””””””””””””””’
‘ <p>Title: </p>        ‘
‘ <p>content:encoded: 签名所需MD5加密ASP函数库</p> ‘
‘ <p>Copyright: Copyright (c) 2005</p>   ‘
‘ <p>Company: 快钱网</p>      ‘
‘ @author Stephen.Ye       ‘
‘ @version 1.0         ‘
””””””””””””””””””””””””’
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32

Private m_lOnBits(30)
Private m_l2Power(30)

Private Function LShift(lValue, iShiftBits)
    If iShiftBits = 0 Then
        LShift = lValue
        Exit Function
    ElseIf iShiftBits = 31 Then
        If lValue And 1 Then
            LShift = &H80000000
        Else
            LShift = 0
        End If
        Exit Function
    ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
        Err.Raise 6
    End If

    If (lValue And m_l2Power(31 – iShiftBits)) Then
        LShift = ((lValue And m_lOnBits(31 – (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
    Else
        LShift = ((lValue And m_lOnBits(31 – iShiftBits)) * m_l2Power(iShiftBits))
    End If
End Function

Private Function RShift(lValue, iShiftBits)
    If iShiftBits = 0 Then
        RShift = lValue
        Exit Function
    ElseIf iShiftBits = 31 Then
        If lValue And &H80000000 Then
            RShift = 1
        Else
            RShift = 0
        End If
        Exit Function
    ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
        Err.Raise 6
    End If
   
    RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)

    If (lValue And &H80000000) Then
        RShift = (RShift Or (&H40000000 \ m_l2Power(iShiftBits – 1)))
    End If
End Function

Private Function RotateLeft(lValue, iShiftBits)
    RotateLeft = LShift(lValue, iShiftBits) Or RShift(lValue, (32 – iShiftBits))
End Function

Private Function AddUnsigned(lX, lY)
    Dim lX4
    Dim lY4
    Dim lX8
    Dim lY8
    Dim lResult

    lX8 = lX And &H80000000
    lY8 = lY And &H80000000
    lX4 = lX And &H40000000
    lY4 = lY And &H40000000

    lResult = (lX And &H3FFFFFFF) + (lY And &H3FFFFFFF)

    If lX4 And lY4 Then
        lResult = lResult Xor &H80000000 Xor lX8 Xor lY8
    ElseIf lX4 Or lY4 Then
        If lResult And &H40000000 Then
            lResult = lResult Xor &HC0000000 Xor lX8 Xor lY8
        Else
            lResult = lResult Xor &H40000000 Xor lX8 Xor lY8
        End If
    Else
        lResult = lResult Xor lX8 Xor lY8
    End If

    AddUnsigned = lResult
End Function

Private Function md5_F(x, y, z)
    md5_F = (x And y) Or ((Not x) And z)
End Function

Private Function md5_G(x, y, z)
    md5_G = (x And z) Or (y And (Not z))
End Function

Private Function md5_H(x, y, z)
    md5_H = (x Xor y Xor z)
End Function

Private Function md5_I(x, y, z)
    md5_I = (y Xor (x Or (Not z)))
End Function

Private Sub md5_FF(a, b, c, d, x, s, ac)
    a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_F(b, c, d), x), ac))
    a = RotateLeft(a, s)
    a = AddUnsigned(a, b)
End Sub

Private Sub md5_GG(a, b, c, d, x, s, ac)
    a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_G(b, c, d), x), ac))
    a = RotateLeft(a, s)
    a = AddUnsigned(a, b)
End Sub

Private Sub md5_HH(a, b, c, d, x, s, ac)
    a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_H(b, c, d), x), ac))
    a = RotateLeft(a, s)
    a = AddUnsigned(a, b)
End Sub

Private Sub md5_II(a, b, c, d, x, s, ac)
    a = AddUnsigned(a, AddUnsigned(AddUnsigned(md5_I(b, c, d), x), ac))
    a = RotateLeft(a, s)
    a = AddUnsigned(a, b)
End Sub

Private Function ConvertToWordArray(sMessage)
    Dim lMessageLength
    Dim lNumberOfWords
    Dim lWordArray()
    Dim lBytePosition
    Dim lByteCount
    Dim lWordCount
   
    Const MODULUS_BITS = 512
    Const CONGRUENT_BITS = 448
   
    lMessageLength = Len(sMessage)
   
    lNumberOfWords = (((lMessageLength + ((MODULUS_BITS – CONGRUENT_BITS) \ BITS_TO_A_BYTE)) \ (MODULUS_BITS \ BITS_TO_A_BYTE)) + 1) * (MODULUS_BITS \ BITS_TO_A_WORD)
    ReDim lWordArray(lNumberOfWords – 1)
   
    lBytePosition = 0
    lByteCount = 0
    Do Until lByteCount >= lMessageLength
        lWordCount = lByteCount \ BYTES_TO_A_WORD
        lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE
        lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(Asc(Mid(sMessage, lByteCount + 1, 1)), lBytePosition)
        lByteCount = lByteCount + 1
    Loop

    lWordCount = lByteCount \ BYTES_TO_A_WORD
    lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE

    lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(&H80, lBytePosition)

    lWordArray(lNumberOfWords – 2) = LShift(lMessageLength, 3)
    lWordArray(lNumberOfWords – 1) = RShift(lMessageLength, 29)
   
    ConvertToWordArray = lWordArray
End Function

Private Function WordToHex(lValue)
    Dim lByte
    Dim lCount
   
    For lCount = 0 To 3
        lByte = RShift(lValue, lCount * BITS_TO_A_BYTE) And m_lOnBits(BITS_TO_A_BYTE – 1)
        WordToHex = WordToHex & Right("0" & Hex(lByte), 2)
    Next
End Function

Public Function MD5(sMessage)
    m_lOnBits(0) = CLng(1)
    m_lOnBits(1) = CLng(3)
    m_lOnBits(2) = CLng(7)
    m_lOnBits(3) = CLng(15)
    m_lOnBits(4) = CLng(31)
    m_lOnBits(5) = CLng(63)
    m_lOnBits(6) = CLng(127)
    m_lOnBits(7) = CLng(255)
    m_lOnBits(8) = CLng(511)
    m_lOnBits(9) = CLng(1023)
    m_lOnBits(10) = CLng(2047)
    m_lOnBits(11) = CLng(4095)
    m_lOnBits(12) = CLng(8191)
    m_lOnBits(13) = CLng(16383)
    m_lOnBits(14) = CLng(32767)
    m_lOnBits(15) = CLng(65535)
    m_lOnBits(16) = CLng(131071)
    m_lOnBits(17) = CLng(262143)
    m_lOnBits(18) = CLng(524287)
    m_lOnBits(19) = CLng(1048575)
    m_lOnBits(20) = CLng(2097151)
    m_lOnBits(21) = CLng(4194303)
    m_lOnBits(22) = CLng(8388607)
    m_lOnBits(23) = CLng(16777215)
    m_lOnBits(24) = CLng(33554431)
    m_lOnBits(25) = CLng(67108863)
    m_lOnBits(26) = CLng(134217727)
    m_lOnBits(27) = CLng(268435455)
    m_lOnBits(28) = CLng(536870911)
    m_lOnBits(29) = CLng(1073741823)
    m_lOnBits(30) = CLng(2147483647)
   
    m_l2Power(0) = CLng(1)
    m_l2Power(1) = CLng(2)
    m_l2Power(2) = CLng(4)
    m_l2Power(3) = CLng(8)
    m_l2Power(4) = CLng(16)
    m_l2Power(5) = CLng(32)
    m_l2Power(6) = CLng(64)
    m_l2Power(7) = CLng(128)
    m_l2Power(8) = CLng(256)
    m_l2Power(9) = CLng(512)
    m_l2Power(10) = CLng(1024)
    m_l2Power(11) = CLng(2048)
    m_l2Power(12) = CLng(4096)
    m_l2Power(13) = CLng(8192)
    m_l2Power(14) = CLng(16384)
    m_l2Power(15) = CLng(32768)
    m_l2Power(16) = CLng(65536)
    m_l2Power(17) = CLng(131072)
    m_l2Power(18) = CLng(262144)
    m_l2Power(19) = CLng(524288)
    m_l2Power(20) = CLng(1048576)
    m_l2Power(21) = CLng(2097152)
    m_l2Power(22) = CLng(4194304)
    m_l2Power(23) = CLng(8388608)
    m_l2Power(24) = CLng(16777216)
    m_l2Power(25) = CLng(33554432)
    m_l2Power(26) = CLng(67108864)
    m_l2Power(27) = CLng(134217728)
    m_l2Power(28) = CLng(268435456)
    m_l2Power(29) = CLng(536870912)
    m_l2Power(30) = CLng(1073741824)

    Dim x
    Dim k
    Dim AA
    Dim BB
    Dim CC
    Dim DD
    Dim a
    Dim b
    Dim c
    Dim d
   
    Const S11 = 7
    Const S12 = 12
    Const S13 = 17
    Const S14 = 22
    Const S21 = 5
    Const S22 = 9
    Const S23 = 14
    Const S24 = 20
    Const S31 = 4
    Const S32 = 11
    Const S33 = 16
    Const S34 = 23
    Const S41 = 6
    Const S42 = 10
    Const S43 = 15
    Const S44 = 21

    x = ConvertToWordArray(sMessage)
   
    a = &H67452301
    b = &HEFCDAB89
    c = &H98BADCFE
    d = &H10325476

    For k = 0 To UBound(x) Step 16
        AA = a
        BB = b
        CC = c
        DD = d
   
        md5_FF a, b, c, d, x(k + 0), S11, &HD76AA478
        md5_FF d, a, b, c, x(k + 1), S12, &HE8C7B756
        md5_FF c, d, a, b, x(k + 2), S13, &H242070DB
        md5_FF b, c, d, a, x(k + 3), S14, &HC1BDCEEE
        md5_FF a, b, c, d, x(k + 4), S11, &HF57C0FAF

        md5_FF d, a, b, c, x(k + 5), S12, &H4787C62A
        md5_FF c, d, a, b, x(k + 6), S13, &HA8304613
        md5_FF b, c, d, a, x(k + 7), S14, &HFD469501
        md5_FF a, b, c, d, x(k + 8), S11, &H698098D8
        md5_FF d, a, b, c, x(k + 9), S12, &H8B44F7AF
        md5_FF c, d, a, b, x(k + 10), S13, &HFFFF5BB1
        md5_FF b, c, d, a, x(k + 11), S14, &H895CD7BE
        md5_FF a, b, c, d, x(k + 12), S11, &H6B901122
        md5_FF d, a, b, c, x(k + 13), S12, &HFD987193
        md5_FF c, d, a, b, x(k + 14), S13, &HA679438E
        md5_FF b, c, d, a, x(k + 15), S14, &H49B40821
   
        md5_GG a, b, c, d, x(k + 1), S21, &HF61E2562
        md5_GG d, a, b, c, x(k + 6), S22, &HC040B340
        md5_GG c, d, a, b, x(k + 11), S23, &H265E5A51
        md5_GG b, c, d, a, x(k + 0), S24, &HE9B6C7AA
        md5_GG a, b, c, d, x(k + 5), S21, &HD62F105D
        md5_GG d, a, b, c, x(k + 10), S22, &H2441453
        md5_GG c, d, a, b, x(k + 15), S23, &HD8A1E681
        md5_GG b, c, d, a, x(k + 4), S24, &HE7D3FBC8
        md5_GG a, b, c, d, x(k + 9), S21, &H21E1CDE6
        md5_GG d, a, b, c, x(k + 14), S22, &HC33707D6
        md5_GG c, d, a, b, x(k + 3), S23, &HF4D50D87
        md5_GG b, c, d, a, x(k + 8), S24, &H455A14ED
        md5_GG a, b, c, d, x(k + 13), S21, &HA9E3E905
        md5_GG d, a, b, c, x(k + 2), S22, &HFCEFA3F8
        md5_GG c, d, a, b, x(k + 7), S23, &H676F02D9
        md5_GG b, c, d, a, x(k + 12), S24, &H8D2A4C8A
           
        md5_HH a, b, c, d, x(k + 5), S31, &HFFFA3942
        md5_HH d, a, b, c, x(k + 8), S32, &H8771F681
        md5_HH c, d, a, b, x(k + 11), S33, &H6D9D6122
        md5_HH b, c, d, a, x(k + 14), S34, &HFDE5380C
        md5_HH a, b, c, d, x(k + 1), S31, &HA4BEEA44
        md5_HH d, a, b, c, x(k + 4), S32, &H4BDECFA9
        md5_HH c, d, a, b, x(k + 7), S33, &HF6BB4B60
        md5_HH b, c, d, a, x(k + 10), S34, &HBEBFBC70
        md5_HH a, b, c, d, x(k + 13), S31, &H289B7EC6
        md5_HH d, a, b, c, x(k + 0), S32, &HEAA127FA
        md5_HH c, d, a, b, x(k + 3), S33, &HD4EF3085
        md5_HH b, c, d, a, x(k + 6), S34, &H4881D05
        md5_HH a, b, c, d, x(k + 9), S31, &HD9D4D039
        md5_HH d, a, b, c, x(k + 12), S32, &HE6DB99E5
        md5_HH c, d, a, b, x(k + 15), S33, &H1FA27CF8
        md5_HH b, c, d, a, x(k + 2), S34, &HC4AC5665
   
        md5_II a, b, c, d, x(k + 0), S41, &HF4292244
        md5_II d, a, b, c, x(k + 7), S42, &H432AFF97
        md5_II c, d, a, b, x(k + 14), S43, &HAB9423A7
        md5_II b, c, d, a, x(k + 5), S44, &HFC93A039
        md5_II a, b, c, d, x(k + 12), S41, &H655B59C3
        md5_II d, a, b, c, x(k + 3), S42, &H8F0CCC92
        md5_II c, d, a, b, x(k + 10), S43, &HFFEFF47D
        md5_II b, c, d, a, x(k + 1), S44, &H85845DD1
        md5_II a, b, c, d, x(k + 8), S41, &H6FA87E4F
        md5_II d, a, b, c, x(k + 15), S42, &HFE2CE6E0
        md5_II c, d, a, b, x(k + 6), S43, &HA3014314
        md5_II b, c, d, a, x(k + 13), S44, &H4E0811A1
        md5_II a, b, c, d, x(k + 4), S41, &HF7537E82
        md5_II d, a, b, c, x(k + 11), S42, &HBD3AF235
        md5_II c, d, a, b, x(k + 2), S43, &H2AD7D2BB
        md5_II b, c, d, a, x(k + 9), S44, &HEB86D391
   
        a = AddUnsigned(a, AA)
        b = AddUnsigned(b, BB)
        c = AddUnsigned(c, CC)
        d = AddUnsigned(d, DD)
    Next
   
    MD5 = LCase(WordToHex(a) & WordToHex(b) & WordToHex(c) & WordToHex(d)) ’32byte
    ‘MD5 = LCase(WordToHex(b) & WordToHex(c)) ‘I crop this to fit 16byte database password :D
End Function
‘引用方法:rs("PSW")=md5("需要转换的字符")
response.Write("md5->ge star"&md5("ge star")&"<br>")
response.Write("md5->gestar"&md5("gestar")&"<br>")
response.Write("md5->1"&md5("1"))
%>