asp生成HTM静态列表分页(含代码,已测试成功)(2)_ASP教程
推荐:解读ASP程序执行SQL语句时防止注入攻击的问题以下是一个简单的用户更改密码的代码 --------------------- username=request(user_name) pwd=request(pwd) username=replace(username,’,’’) pwd=replace(pwd,’,’’) sql=updatetbl_testsetpwd=’pwd’whereuid=’username’ setrs=
<%
'分页部分
ref=""
ref=ref&"<br>"
ref=ref&"<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=0 cellspacing=1> "
ref=ref&"<tr bgcolor=#f7f7f7>"
ref=ref&"<td> "
ref=ref&"<b>Pages: " & j & " / " & totalpage &"</b>"
ref=ref&"</td>"
ref=ref&"<td> "
ref=ref&"<a href=list_1.html"&">" & "<FONT face=Webdings>9</FONT>" & "</a> "
if whichpage=1 then
ref=ref&"<FONT face=Webdings>7</FONT>"
else
ref=ref&"<a href=list_"&j-1&".html"&">" & "<FONT face=Webdings>7</FONT>" & "</a> "
end if
for counter=1 to totalpage
ref=ref&"<a href=list_"&counter&".html"&">[" & counter & "]</a>"
ref=ref& " "
if counter mod 10 = 0 then
ref=ref& "<br>"
end if
next
if (whichpage>totalpage or whichpage=totalpage) then
ref=ref&"<FONT face=Webdings>8</FONT>"
else
ref=ref&"<a href=list_"&j+1&".html"&">" & "<FONT face=Webdings>8</FONT>" & "</a> "
end if
ref=ref&"<a href=list_"&totalpage&".html"&">" & "<FONT face=Webdings>:</FONT>" & "</a> "
Dim fso,f
Dim strTitle,strContent,strOut
'创建文件系统对象
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.CreateTextFile(Server.MapPath("list_"&j&".html"),true)
'写入网页内容
f.WriteLine strHead&str0&ref
f.close
response.write "正在生成第"&j&"个页面!<br>"
%><%
next%>
源代码,已测试成功! htmlpage_demo.rar
解压密码:www.code-123.com分享:揭秘asp常用函数库大全’-----------------FLYSOBlogASP站点开发常用函数库------------------ ’OpenDB(vdata_url)--------------------打开数据库 ’getIp()-------------------------------得到真实IP ’getIPAdress(sip)------------------------查找ip对应的真实地址 ’IP2Num
- 相关链接:
- 教程说明:
ASP教程-asp生成HTM静态列表分页(含代码,已测试成功)(2)。