易截截图软件、单文件、免安装、纯绿色、仅160KB

asp数组cookies操作函数


本文的创造性在于cookies_to_array(c)   直接简单快捷转化字符串为数组的方法
另外 本文操作的数组 不是 asp普通的多维数组 而是锯齿型的
这种数组 更易操作 更易阅读 行列清晰 很像数据库中的表
可以类比为 datatable
class myarray
'必须为锯齿数组array(array(1,2,3))
function array_to_cookies(a)
dim b(),i,j,u
u = ubound(a)
redim b(u)
for i=0 to u
array_rep a(i)
b(i)=join(a(i),",")
next
array_to_cookies=join(b,";")
end function
sub array_rep(a)
dim i
if isarray(a) then
for i=0 to ubound(a)
if instr(a(i),",")>0 then a(i)=replace(a(i),",","")
if instr(a(i),";")>0 then a(i)=replace(a(i),";","")
next
end if
end sub
function cookies_to_array(c)
c = "array(array("+replace(c,";","),array(")+"))"
execute "cookies_to_array="&c
end function
'以某列为主键 添加或者更新 行
sub add_row(a,ai,columnum)
dim b(),i,j,u
u = ubound(a)
if columnum=-1 then'add
redim b(u+1)
else
redim b(u)
end if
j=0
for i=0 to u
if columnum>-1 then
if a(i)(columnum)<>ai(columnum) then
b(j)=a(i)
j = j+1
else
b(j)=ai
j = j+1
end if
else
b(j)=a(i)
j = j+1
end if
next
if columnum=-1 then
b(j)=ai
end if
a=b
end sub
function get_rownum(a,columnum,columv)
get_rownum=-1
dim i,j,u
u = ubound(a)
for i=0 to u
if a(i)(columnum)=columv then
get_rownum = i
exit function
end if
next
end function
'根据列号 列值 删除某xie行 直接改变原数组
sub delete_row_by_colum(a,columnum,columv)
dim b(),i,j,u
u = ubound(a)
j =0
for i=0 to u
if a(i)(columnum)=columv then
j=j+1
end if
next
redim b(u-j)
j=0
for i=0 to u
if a(i)(columnum)<>columv then
b(j)=a(i)
j = j+1
end if
next
a=b
end sub
'根据行下标删除行
sub delete_row(a,rownum)
dim b(),i,j,u
u = ubound(a)
j =0
redim b(u-1)


相关文档:

asp常用文件操作函数(二)

<%    
    '*******************************************************
    '作  用: 得到文件扩展名
    '函数名: GetFileExt(fileTrue)
    '参  数: sFileName 文件名
   ......

如何调试ASP代码

环境工具:
Visual studio 2008/2005
IIS 6.0
调试步骤如下: 
 
(1) IIS启用调试
1.     计算机管理->服务和应用程序->Internet信息服务->网站->默认网站->属性
2.     主目录->应用程序配置->调试
3.     启用ASP服 ......

在线查找/正则替换文件中文本的网页接口(asp)

<%
response.Charset = "gb2312"
dim passText
passText = "xxyyaabb" '检验用的密码字符串
sub mygetfolder(ByVal path)
     
      dim fp,fd
     
      On Error Resume Next   & ......

通用asp防注入程序

‘防注入把它加到conn里这样就ok了
dim sql_injdata
SQL_injdata = "’|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.QueryString<>"" Then
For Each SQL_Get In Request.QueryString
For SQL_Data=0 To Ubo ......

第一章 ASP介绍

教学内容
ASP动态网页设计技术体系结构
ASP主要构成元素的功能及用法
ASP动态网页设计实例
重点和难点
asp动态网页设计技术体系结构
asp动态网页设计的方法
前导知识
脚本语言——vbscript或javascript
数据库知识——SQL
参阅资料
HTTP://WWW.w3schools.com
推荐软件:Adobe Dreamweaver ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号