易截截图软件、单文件、免安装、纯绿色、仅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常用文件操作函数(一)

<%
    
    '*******************************************************
    '函数名:CreateFolder(sPath)
    '作  用: 创建目录
    '参  数:sPath : 创建的相对目录路径
 & ......

ASP实现同一虚拟主机空间安放多个网站的方法

ASP实现同一虚拟主机空间安放多个网站的方法
  现在的域名很便宜,不少朋友手里多少都有几个,如果您想用手中的几个域名做多个网站的话,并不用同时购买多个虚拟主机,您只要先将您所有的域名绑定到您的虚拟主机上,然后将虚拟主机根目录中的index.asp(首页文件)里加入下列代码就可以了:
<%
sn=lcase(Request.Se ......

IIS for XP 调试ASP 解决全方案

安装过程顺畅,ASP页面在其它环境下能正常调试,文件路径配置正确情况下,不能调试ASP 页面,参考一下内容
第一
修改端口配置  一些优化和防护软件对端口有特殊的“照顾”
第二
常见的“500内部服务器错误”万金油:
1、卸载“internet信息服务(IIS)”,
2、看看事件查看器里有没 ......

asp及asp.net的urlencode问题

我想在asp中加一个链接,指向asp.net网页,但asp.net的网址是经过HttpUtility.UrlEncode变形和HttpUtility.UrlDecode变回的,而asp的server.urlencode却产生不了和HttpUtility.UrlEncode一样的编码,请问有没有解决办法
补充:原来asp.net的是"web.aspx?str="+HttpUtility.UrlEncode(str)
和HttpUtility.UrlDecode(Requ ......

ASP中的记录集

eof是asp中recordset对象指针的一种。
rs.eof 返回记录指针是否超出数据表末端,true表示是,false为否
rs记录集是我们经常会碰到的,下面对它诸多的移动指针进行汇总,如下:
rs.movenext 将记录指针从当前的位置向下移一行
rs.moveprevious 将记录指针从当前的位置向上移一行
rs.movefirst 将记录指针移到数据表第一行 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号