<?xml version="1.0" encoding="UTF-8"?>
<rss>
<channel>
<title>兄弟的博客【L-BLOG，网络电视精灵】</title>
<link>http://www.030904.com/blog</link>
<Description>兄弟的博客【L-BLOG，网络电视精灵】</Description>
<language>zh-cn</language>
<copyright>Copyright 2003-2004 Loveyuki</copyright>
<webMaster>webmaster@loveyuki.com</webMaster>
<image>
	<title>兄弟的博客【L-BLOG，网络电视精灵】</title> 
	<url>http://www.030904.com/blog/images/logos.gif</url> 
	<link>http://www.030904.com/blog</link> 
	<description>兄弟的博客【L-BLOG，网络电视精灵】</description> 
</image>
<item><link>http://www.030904.com/blog/blogview.asp?logID=1007</link><title><![CDATA[给L-BLOG加上智能黑名单系统]]></title><author>glenluo</author><category>建站心得</category><pubDate>2010-3-13 21:49:23</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1007</guid><description><![CDATA[现在发现这个L-BLOG被我改的太完美了，功能已经非常的强大了，今天，就再来一个非常有用的功能，智能黑名单系统，原理很简单，就是每次用户提交参数错误以后，就自动记录错误记录，当记录大于等于三的时候，就自动将用户列入黑名单了，到了第二天用户才可以访问本站。<br><br>现在，我们来设计数据库的表了，不用很复杂，几个字段就可以了，重点是记录错误来源的页面以及提交的IP以及时间即可，所以，字段设计如下：<br>Err_id&nbsp;&nbsp;自动编号&nbsp;主键<br>Errorip&nbsp;&nbsp;文本&nbsp;字段大小20<br>Errorref&nbsp;&nbsp;文本&nbsp;字段大小100<br>Add_time&nbsp;&nbsp;时间/日期&nbsp;默认值Now()<br>保存表的名字为：blackip<br><br>然后在include/library.asp的最后，也就是&quot;%&gt;&quot;之前加上以下代码：<br>Sub&nbsp;Add_blackip<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;Errorref,Errorip<br>&nbsp;&nbsp;&nbsp;&nbsp;Errorref=request.servervariables(&quot;http_referer&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Errorip=Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Conn.execute(&quot;Insert&nbsp;into&nbsp;blackip&nbsp;(Errorref,Errorip)&nbsp;values(&#39;&quot;&amp;Errorref&amp;&quot;&#39;,&#39;&quot;&amp;Errorip&amp;&quot;&#39;)&quot;)<br>End&nbsp;Sub<br><br>Sub&nbsp;Blockip<br>&nbsp;&nbsp;&nbsp;&nbsp;Erroripnum=Conn.ExeCute(&quot;SELECT&nbsp;COUNT(Err_id)&nbsp;FROM&nbsp;blackip&nbsp;WHERE&nbsp;Errorip=&#39;&quot;&amp;Guest_IP&amp;&quot;&#39;&nbsp;and&nbsp;Day(Add_time)=Day(Now)&quot;)(0)<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Erroripnum&gt;=3&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;Response.write(&quot;&lt;center&gt;&lt;font&nbsp;color=red&gt;由于你今天多次提交表单错误,系统自动屏蔽了你的IP,请改天再来吧!&lt;/font&gt;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Response.end<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;if<br>End&nbsp;Sub<br><br>接着在你的blogcomm.asp；guestbook.asp；photoshow.asp；register.asp等页面的每个出错提示后加上Call&nbsp;Add_blackip<br><br>比如：<br>ElseIf&nbsp;Trim(Request.Form(&quot;validatecode&quot;))=Empty&nbsp;Or&nbsp;Trim(Session(&quot;L-Blog_ValidateCode&quot;))&lt;&gt;Trim(Request.Form(&quot;validatecode&quot;))&nbsp;Then<br>msg_Title=&quot;出现错误&quot;<br>msg_Content=&quot;&lt;a&nbsp;href=&quot;&quot;javascript:history.go(-1);&quot;&quot;&gt;你没有输入验证码或验证码错误，点击返回上一页&lt;/a&gt;&quot;<br>Call&nbsp;Add_blackip&#39;这个是新增加的内容<br><br>最后在commond.asp里面找到站点统计代码，在End&nbsp;if后面加上：Call&nbsp;Blockip<br><br>哈哈，整个智能系统就完成了！赶快行动，给自己的博客增加防火墙吧！<br><br><img src="attachments/month_1003/if8m_test.JPG" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" /><br><br>为了方便大家，数据库我已经打包放上来了，大家导入你的数据库就可以使用了！<br><br><img src="images/download.gif" align="absmiddle" /> <a href="attachments/month_1003/pmft_data.rar" target="_blank">点击下载此文件</a>]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1006</link><title><![CDATA[电子科技大学许愿门事件]]></title><author>glenluo</author><category>心情日记</category><pubDate>2010-3-12 21:12:06</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1006</guid><description><![CDATA[许愿门事件源于三八妇女节前一天的三七女生节。3月7日是电子科大女生们的“女生节”，今年是电子科技大学第三届女生节，像往年一样，女生们贴出了自己的节日愿望。科大女生们都可在食堂门口的“心愿板”上，写下节日愿望。路过的男生们，则可挑选一则，去帮助女生们完成心愿。于是，“我要一件性感内衣”“我要一个老公，”“我要一个别墅”···冒出了一系列“雷人”心愿。90后的小女生们都很天真，许的愿望也都很可爱。比如我的吹风机坏了呀，比如想看看科大最帅的帅哥啦，再比如想吃德克士了等等。该校“女生节”便成了有名的“山寨情人节”。&nbsp;<br><br>而众多愿望中却独独有一个愿望吸引了众多人的关注，也由此引发“科大许愿门”事件。&nbsp;<br>看图说话！&nbsp;<br><br>今天中午突然爆发了“许愿门”事件，起因就是下面这个女生节的心愿&nbsp;<br><br><div class="code_head"><input id="VOBJ_7643" type="hidden" value="-1" /><a href="javascript:UBBShowObj('swf','OBJ_7643','http://www.tudou.com/v/XSgcEPc9nTE','550','400');"><img src="images/icon_media.gif" alt="显示影音文件" align="absmiddle" border="0" /> 点击显示/隐藏影音文件</a></div><div id="OBJ_7643" class="code_main">影音源文件地址：<a href="http://www.tudou.com/v/XSgcEPc9nTE" target="_blank">http://www.tudou.com/v/XSgcEPc9nTE</a></div><br><br><img src="attachments/month_1003/eb4h_001.jpg" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" /><br><img src="attachments/month_1003/da3g_002.jpg" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" />]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1005</link><title><![CDATA[邓丽欣不雅照事件]]></title><author>glenluo</author><category>心情日记</category><pubDate>2010-3-12 21:06:01</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1005</guid><description><![CDATA[邓丽欣是2000年度《Yes！校花校草选举》冠军，后来加入歌唱组合Cookies成为队长。以唱歌为主要事业，亦涉猎电影、歌曲创作和写书等。<br><br>　　本报讯(记者&nbsp;潘媛&nbsp;实习生&nbsp;吴洋)从2008年2月YANZHAOMEN爆发后，先后有7位女艺人受到牵连，其中包括张柏芝、阿娇、陈文媛以及陈冠希的正牌女友杨永晴。事件过去两年，近日再起风云：曾有玉女之称的香港女星邓丽欣被八卦杂志曝光，称其一段6分钟的不雅视频流出。不过昨日邓丽欣与其经纪公司金牌大风方面均否认此事的真实性。&nbsp;<br><br>　　八卦杂志曝光邓丽欣不雅视频截图&nbsp;<br><br><img src="http://images.qianlong.com/mmsource/imghylanda/201003/12/11/4684587405940801211.jpg" border="0" onload="javascript:DrawImage(this);"  alt="按此在新窗口打开图片" onmouseover="this.style.cursor='hand';" onclick="window.open(this.src);" /><br><br><a target="_blank" href="http://yesee.qianlong.com/3910/2010/03/12/4542@5561989.htm">http://yesee.qianlong.com/3910/2010/03/12/4542@5561989.htm</a>]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1004</link><title><![CDATA[ASP中几个实用的小技巧]]></title><author>glenluo</author><category>建站心得</category><pubDate>2010-3-12 19:05:05</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1004</guid><description><![CDATA[ASP计算天数差的函数-Datediff<br><br>今天自己遇到个简单的问题，不过估计太笨了，竟然还去找了资料才知道怎么用。就是ASP计算天数差的函数，下面给出函数用法：<br>&lt;%=DateDiff(&quot;d&quot;,&quot;2009-12-10&quot;,Date())%&gt;<br>特别注意得是，日期差的值，是用后面的日期减去前面的日期！大家顺序不要搞错了哦，否则会出现负值<br><br><br>判断数据库字段值为空的方法<br><br>判断数据库字段值为空的方法：<br>如果你用&nbsp;if&nbsp;rs(&quot;XXX&quot;)=&quot;&quot;&nbsp;then&nbsp;那么很容易出错，而且得不到结果，<br>只能用的办法是：isnull(rs(&quot;XX&quot;))=true<br>在这里把我遇到的问题和大家分享！&nbsp;<br><br><br>防网站小偷来采摘数据<br><br>防网站小偷来采摘数据。自己辛苦写的文章或者培养的站点不想那么快那么容易就被人采集掠夺资源吧，下面一个小函数可以帮助大家解决部<br><br>分问题：<br>function&nbsp;Appeal()<br>Dim&nbsp;AppealNum,AppealCount<br>&nbsp;&nbsp;&nbsp;AppealNum=30&nbsp;&#39;同一IP10秒内请求限制30次<br>&nbsp;&nbsp;&nbsp;AppealCount=Request.Cookies(&quot;AppealCount&quot;)&nbsp;<br>&nbsp;&nbsp;&nbsp;If&nbsp;AppealCount=&quot;&quot;&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;response.Cookies(&quot;AppealCount&quot;)=1<br>&nbsp;&nbsp;&nbsp;&nbsp;AppealCount=1<br>&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;AppealCount&quot;).expires=dateadd(&quot;s&quot;,10,now())<br>&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;response.Cookies(&quot;AppealCount&quot;)=AppealCount+1<br>&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;AppealCount&quot;).expires=dateadd(&quot;s&quot;,10,now())<br>&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;if&nbsp;int(AppealCount)&gt;int(AppealNum)&nbsp;then<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;FIELDSET&nbsp;style=&#39;width:350px&#39;&gt;&lt;LEGEND&gt;描述&lt;/LEGEND&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px&#39;&gt;抓取很累，歇一会儿吧！&lt;/font&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/FIELDSET&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.end<br>&nbsp;&nbsp;End&nbsp;If&nbsp;<br>end&nbsp;function&nbsp;<br><br><br>asp获取完整URL地址以及参数<br><br>很多人用JS来获取网站的URL，但有时候需要ASP代码来获取，下面的例子可以供大家参考：<br>&lt;%<br>response.write&nbsp;&quot;http://&quot;&amp;Cstr(Request.ServerVariables(&quot;SERVER_NAME&quot;))&amp;Cstr(Request.ServerVariables(&quot;URL&quot;))<br><br>&amp;&quot;?&quot;&amp;request.QueryString<br>%&gt;&nbsp;<br><br><br>ASP终止死循环程序或者关闭Access数据库<br><br>利用Access做为数据库进行动态网站开发的时候我们经常会遇到些问题。就是程序遇到了死循环或者占用了大量的服务器资源导致数据库一直<br><br>呈打开锁定状态。这个时候非常麻烦。解决办法有两个。第一，如果是在本地调试，可以重新启动IIS来终止进程。或者手工打开Access数据库<br><br>，再关闭，这样也可以关闭数据库。<br>但要是遇到在服务器上运行时出现了问题，很明显，上面的两种方法更本无法使用。那我们如果要重新传数据库覆盖原来的文件就无法操作了<br><br>。因为数据库是打开状态，无法进行任何写操作。&nbsp;不过，下面的方法可以解决在服务器上调试或运行程序遇到的问题。把下面的代码保存成<br><br>asp文件，然后传至服务器上，运行文件。一切就轻松搞定了！<br>&lt;%sub&nbsp;ClearCache<br>&nbsp;&nbsp;application.Contents.RemoveAll()<br>&nbsp;&nbsp;Session.Contents.RemoveAll()<br>end&nbsp;sub<br>call&nbsp;ClearCache()<br>%&gt;&nbsp;<br><br><br>获取一个&nbsp;URL地址的网页文件名<br><br>&lt;%<br>&#39;这段代码是获取一个&nbsp;URL地址的网页文件名.<br>changdu=len(request.ServerVariables(&quot;URL&quot;))<br>url=instrrev(request.ServerVariables(&quot;URL&quot;),&quot;/&quot;)<br>url=url+1<br>ends=changdu+1-url<br>finally=mid(request.ServerVariables(&quot;URL&quot;),url,ends)&nbsp;&#39;finally是最终的文件名<br>response.Write&nbsp;finally<br>%&gt;&nbsp;<br><br>]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1003</link><title><![CDATA[asp设置cookies过期时间的方法]]></title><author>glenluo</author><category>编程技术</category><pubDate>2010-3-12 19:00:03</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1003</guid><description><![CDATA[Response.Cookies(&quot;user_name&quot;).Expires=Date+1&nbsp;&#39;指定cookie保存时间&nbsp;<br><br>保留COOKIES一个小时&nbsp;<br>Response.Cookies(&quot;MyCookie&quot;).Expires=&nbsp;(now()+1/24)&nbsp;<br><br>Response.Cookies(&quot;MyCookie&quot;).Expires&nbsp;=&nbsp;DateAdd(&quot;h&quot;,&nbsp;1,&nbsp;Now())&nbsp;<br><br>Response.Cookies(&quot;CookieName&quot;).Expires=DateAdd(&quot;m&quot;,60,now())&nbsp;<br>设置60个月以后过期&nbsp;<br><br>Response.Cookies(&quot;User&quot;).expires=second()+7&nbsp;<br>在expires后面定义的时间可以用时间函数代替&nbsp;<br>例如：date()+7就表示在今天的时间上加上7天，而second()+7则是7秒了。&nbsp;<br><br>Response.Cookies(&quot;字段名&quot;).expires=时间函数+N，例如：&nbsp;<br>Response.Cookies(&quot;name2&quot;).expires=date+1，表示Cookies保存1天，再比如：&nbsp;<br>Response.Cookies(&quot;name2&quot;).expires=Hour+8，表示Cookies保存8小时。&nbsp;<br>这种方法我测试过不行（在2003server,iis6.0中)，不管second后面有无加()，访问时会出现500错误（还是无法显示网页？忘了）。&nbsp;<br><br>织梦尤文：这里的时间累加建议还是使用DateAdd函数，比如我们要累加一小时，则使用：&nbsp;<br>Response.Cookies(&quot;baidooglecom&quot;).expires&nbsp;=&nbsp;DateAdd(&quot;h&quot;,&nbsp;1,&nbsp;Now())&nbsp;<br><br>30分钟：&nbsp;<br>Response.Cookies(&quot;CookieName&quot;).Expires=DateAdd(&quot;n&quot;,30,now())&nbsp;<br><br>dateadd(&quot;S&quot;,30,now())&nbsp;得到秒&nbsp;<br><br>Expires&nbsp;指定&nbsp;cookie&nbsp;的过期日期。为了在会话结束后将&nbsp;cookie&nbsp;存储在客户端磁盘上，或在许多时候，我们希望能更长时间地在访问者的计算机上保存cookie。必须设置该日期。&nbsp;<br>若此项属性的设置未超过当前日期，则在任务结束后&nbsp;cookie&nbsp;将到期。&nbsp;<br>cookie的使用到期时间为“2010年1月1日”：&nbsp;Response.Cookies(&quot;CookieName&quot;).Expires=#January&nbsp;01,&nbsp;2010#&nbsp;<br>cookie的过期时间为“cookie的创建时间＋365天”：Response.Cookies(&quot;CookieName&quot;).Expires=Date+365&nbsp;推荐的<br>但最好不要随便写&nbsp;Response.Cookies(&quot;CookieName&quot;).Expires=Date，这样页面之间的调用时值会为空。]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1002</link><title><![CDATA[ASP各种函数功能木块集合]]></title><author>glenluo</author><category>编程技术</category><pubDate>2010-3-12 18:58:51</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1002</guid><description><![CDATA[在这里给大家献上ASP各种函数功能木块集合，这里几乎包含了常用的ASP函数，对网站开发时有着很大的帮助！<br><br>&lt;%<br><br>call&nbsp;start()<br>&#39;开始执行<br>Function&nbsp;start()<br>&nbsp;&nbsp;call&nbsp;get_rq()&nbsp;&#39;安全过滤<br>&nbsp;&nbsp;&#39;call&nbsp;Appeal()&nbsp;&#39;防小偷程序<br>&nbsp;&nbsp;call&nbsp;webAgent()&nbsp;&#39;检测客户端<br>End&nbsp;Function<br>Function&nbsp;createRs()<br>&nbsp;&nbsp;&nbsp;dim&nbsp;rsObj<br>&nbsp;&nbsp;&nbsp;set&nbsp;rsObj=server.CreateObject(&quot;adodb.recordset&quot;)<br>&nbsp;&nbsp;&nbsp;set&nbsp;createRs=rsObj<br>End&nbsp;Function<br><br>sub&nbsp;showError(strval)<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;div&nbsp;style=&quot;&quot;border:1&nbsp;solid&nbsp;#0099FF;&nbsp;width:500px;&nbsp;height:250px;&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;strval<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/div&gt;&quot;<br>&nbsp;&nbsp;response.End()<br>end&nbsp;sub<br><br>&#39;转向<br>Sub&nbsp;RedirectUrl(strHttp)<br>&nbsp;&nbsp;Response.write&nbsp;&quot;&lt;script&nbsp;language=&#39;javascript&#39;&gt;location.href=&#39;&quot;&amp;strHttp&amp;&quot;&#39;;&lt;/script&gt;&quot;<br>End&nbsp;Sub<br><br>sub&nbsp;Alert(sText)<br>&nbsp;&nbsp;Response.write&nbsp;&quot;&lt;script&nbsp;language=&#39;javascript&#39;&gt;alert(&#39;&quot;&nbsp;&amp;&nbsp;sText&nbsp;&amp;&nbsp;&quot;&#39;);&lt;/script&gt;&quot;<br>end&nbsp;sub<br><br>sub&nbsp;History(iStep)<br>&nbsp;&nbsp;Response.write&nbsp;&quot;&lt;script&gt;window.history(&quot;&nbsp;&amp;&nbsp;iStep&nbsp;&amp;&nbsp;&quot;);&lt;/script&gt;&quot;<br>End&nbsp;Sub<br><br>sub&nbsp;Funmsg(iStep,sText)<br>Response.Write&nbsp;&quot;&lt;script&gt;alert(&#39;&quot;&amp;sText&amp;&quot;&#39;);location.href=&#39;&quot;&amp;iStep&amp;&quot;&#39;;&lt;/script&gt;&quot;<br>end&nbsp;sub<br><br>&#39;执行非法提交检测<br>Sub&nbsp;get_rq()<br>dim&nbsp;qs,errc,iii<br>qs=request.servervariables(&quot;query_string&quot;)<br>dim&nbsp;nothis(18)<br>nothis(0)=&quot;net&nbsp;user&quot;<br>nothis(1)=&quot;xp_cmdshell&quot;<br>nothis(2)=&quot;/add&quot;<br>nothis(3)=&quot;exec%20master.dbo.xp_cmdshell&quot;<br>nothis(4)=&quot;net&nbsp;localgroup&nbsp;administrators&quot;<br>nothis(5)=&quot;select&quot;<br>nothis(6)=&quot;count&quot;<br>nothis(7)=&quot;asc&quot;<br>nothis(8)=&quot;char&quot;<br>nothis(9)=&quot;mid&quot;<br>nothis(10)=&quot;&#39;&quot;<br>nothis(11)=&quot;::&quot;<br>nothis(12)=&quot;&quot;&quot;&quot;<br>nothis(13)=&quot;insert&quot;<br>nothis(14)=&quot;delete&quot;<br>nothis(15)=&quot;drop&quot;<br>nothis(16)=&quot;truncate&quot;<br>nothis(17)=&quot;from&quot;<br>nothis(18)=&quot;and&nbsp;user&gt;0&quot;<br>errc=false<br>for&nbsp;iii=&nbsp;0&nbsp;to&nbsp;ubound(nothis)<br>&nbsp;&nbsp;&nbsp;if&nbsp;instr(qs,nothis(iii))&lt;&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;errc=true<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>next<br>if&nbsp;errc&nbsp;then<br>&#39;&nbsp;Response.Write(&quot;对不起，非法URL地址请求!&quot;)<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;meta&nbsp;http-equiv=&quot;&quot;Refresh&quot;&quot;&nbsp;content=&quot;&quot;3;URL=index.html&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;div&nbsp;style=&#39;border:1px&nbsp;solid&nbsp;#CCCCCC;width:600px;height:25px;padding:5px;padding-left:15px;&#39;&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px&#39;&gt;Diggcms系统友情提示：&lt;br&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&amp;nbsp;&amp;nbsp;HTTP&nbsp;错误&nbsp;404&nbsp;-URL地址请求出错&lt;br&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/div&gt;&quot;<br>&nbsp;&nbsp;response.end<br>end&nbsp;if<br>End&nbsp;Sub<br>&#39;初始化被过滤的客户端列表<br>Function&nbsp;webAgent()<br>&nbsp;&nbsp;dim&nbsp;strAgentFilter<br>&nbsp;&nbsp;strAgentFilter=&quot;webzip|||flashget|||offline|||teleport&quot;<br>&nbsp;&nbsp;If&nbsp;ChkAgent(strAgentFilter)=False&nbsp;Then<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;错误&quot;<br>&nbsp;&nbsp;&nbsp;response.End()<br>&nbsp;&nbsp;&nbsp;&#39;&nbsp;AddErrCode(1)<br>&nbsp;&nbsp;&nbsp;&#39;&nbsp;Call&nbsp;ChkError()<br>&nbsp;&nbsp;End&nbsp;If&nbsp;&nbsp;<br>End&nbsp;Function<br>&#39;&nbsp;*&nbsp;检查浏览站点的客户端<br>&#39;&nbsp;*&nbsp;strAL&nbsp;&nbsp;——&nbsp;屏蔽的客户端标志列表<br>Function&nbsp;ChkAgent(strAL)<br>&nbsp;&nbsp;Dim&nbsp;Agent,iijj<br><br>&nbsp;&nbsp;ChkAgent=True<br>&nbsp;&nbsp;Agent=Trim(Lcase(Request.Servervariables(&quot;HTTP_USER_AGENT&quot;)))<br>&nbsp;&nbsp;If&nbsp;(Not&nbsp;IsNull(strAL))&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;strAL=Split(strAL,&quot;|||&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;iijj=0&nbsp;To&nbsp;Ubound(strAL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Instr(Agent,strAL(iijj))&gt;0&nbsp;Then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChkAgent=False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Next<br>&nbsp;&nbsp;End&nbsp;If<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;防网站小偷来采摘数据<br>&#39;&nbsp;*/<br>function&nbsp;Appeal()<br>Dim&nbsp;AppealNum,AppealCount<br>&nbsp;&nbsp;&nbsp;AppealNum=30&nbsp;&#39;同一IP10秒内请求限制30次<br>&nbsp;&nbsp;&nbsp;AppealCount=Request.Cookies(&quot;AppealCount&quot;)&nbsp;<br>&nbsp;&nbsp;&nbsp;If&nbsp;AppealCount=&quot;&quot;&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;response.Cookies(&quot;AppealCount&quot;)=1<br>&nbsp;&nbsp;&nbsp;&nbsp;AppealCount=1<br>&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;AppealCount&quot;).expires=dateadd(&quot;s&quot;,10,now())<br>&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;response.Cookies(&quot;AppealCount&quot;)=AppealCount+1<br>&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;AppealCount&quot;).expires=dateadd(&quot;s&quot;,10,now())<br>&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;if&nbsp;int(AppealCount)&gt;int(AppealNum)&nbsp;then<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;FIELDSET&nbsp;style=&#39;width:350px&#39;&gt;&lt;LEGEND&gt;描述&lt;/LEGEND&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px&#39;&gt;抓取很累，歇一会儿吧！&lt;br&gt;&lt;a&nbsp;href=&quot;&amp;Website&amp;&quot;&gt;&quot;&amp;Website&amp;&quot;&lt;/a&gt;&lt;/font&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/FIELDSET&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.end<br>&nbsp;&nbsp;End&nbsp;If&nbsp;<br>end&nbsp;function<br><br>&#39;/*<br>&#39;&nbsp;防外部提交<br>&#39;&nbsp;结合Chkpost函数<br>&#39;&nbsp;*/<br>function&nbsp;chpost()<br>If&nbsp;Not&nbsp;ChkPost(Website)&nbsp;then<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;center&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;FIELDSET&nbsp;style=&#39;width:350px&#39;&gt;&lt;LEGEND&gt;系统提示&lt;/LEGEND&gt;&quot;<br>&nbsp;&nbsp;Response.Write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px&#39;&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a&nbsp;href=http://www.diggcms.com&gt;返回&lt;/a&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/font&gt;&lt;/FIELDSET&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;br&gt;&lt;br&gt;&lt;div&nbsp;style=&#39;border:1px&nbsp;solid&nbsp;#CCCCCC;width:235px;height:25px;padding:5px;padding-left:15px;&#39;&gt;&lt;a&nbsp;href=http://www.diggcms.com&nbsp;target=_blank&nbsp;title=免费的Diggcms内容管理系统&gt;Diggcms－给你最好的&lt;/a&gt;&lt;/div&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/center&gt;&quot;<br>response.End()<br>end&nbsp;if<br>End&nbsp;function<br><br>&#39;/*<br>&#39;&nbsp;处部提交数据查<br>&#39;&nbsp;*/<br>Function&nbsp;ChkPost(web_url)<br>dim&nbsp;Server_V1,Server_V2<br>ChkPost=False<br>Server_V1=Cstr(Request.ServerVariables(&quot;HTTP_REFERER&quot;))<br>Server_V2=Cstr(Request.ServerVariables(&quot;SERVER_NAME&quot;))<br>&#39;&#39;--------------------------------------------<br>&nbsp;&nbsp;&#39;&#39;Instr(所有，其中),包括&gt;0,否则=0<br>&#39;&#39;--------------------------------------------<br>If&nbsp;Mid(Server_V1,8,Len(Server_V2))&lt;&gt;Server_V2&nbsp;or&nbsp;Instr(web_url,Server_V2)=0&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;ChkPost=False<br>Else<br>&nbsp;&nbsp;&nbsp;&nbsp;ChkPost=True<br>End&nbsp;If<br>End&nbsp;Function<br>&#39;========================================================文件操作<br>&#39;/*<br>&#39;&nbsp;删除文件<br>&#39;&nbsp;*/<br>Function&nbsp;DelFile(DelFilePath)<br>On&nbsp;Error&nbsp;Resume&nbsp;Next<br>DelFile=&nbsp;False<br>set&nbsp;MyFileObject=Server.CreateOBject(&quot;Scripting.FileSystemObject&quot;)<br>MyFileObject.DeleteFile&quot;&quot;&amp;Server.MapPath(&quot;&quot;&amp;DelFilePath&amp;&quot;&quot;)&amp;&quot;&quot;<br>Set&nbsp;MyFileObject=&nbsp;Nothing<br>If&nbsp;0&nbsp;=&nbsp;Err&nbsp;or&nbsp;53&nbsp;=&nbsp;Err&nbsp;Then<br>&nbsp;&nbsp;&nbsp;DelFile=&nbsp;True<br>else<br>&nbsp;&nbsp;&nbsp;CatchError(&quot;&quot;&amp;DelFilePath&amp;&quot;文件无法删除！&quot;)<br>end&nbsp;if<br>On&nbsp;Error&nbsp;GoTo&nbsp;0<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;检查多层目录不存在，则生成<br>&#39;&nbsp;*/<br>function&nbsp;CreateDIR(LocalPath)&nbsp;<br>&nbsp;&nbsp;dim&nbsp;patharr,path_level,i,pathtmp,cpath,FileObject&nbsp;<br>&nbsp;&nbsp;on&nbsp;error&nbsp;resume&nbsp;next&nbsp;<br>&nbsp;&nbsp;LocalPath&nbsp;=&nbsp;Server.MapPath(LocalPath)&nbsp;<br>&nbsp;&nbsp;LocalPath&nbsp;=&nbsp;replace(LocalPath,&quot;\&quot;,&quot;/&quot;)&nbsp;<br>&nbsp;&nbsp;set&nbsp;FileObject&nbsp;=&nbsp;server.createobject(&quot;Scripting.FileSystemObject&quot;)&nbsp;<br>&nbsp;&nbsp;&nbsp;patharr&nbsp;=&nbsp;split(LocalPath,&quot;/&quot;)&nbsp;<br>&nbsp;&nbsp;&nbsp;path_level&nbsp;=&nbsp;ubound(patharr)&nbsp;<br>&nbsp;&nbsp;&nbsp;for&nbsp;i&nbsp;=&nbsp;0&nbsp;to&nbsp;path_level&nbsp;<br>&nbsp;&nbsp;&nbsp;if&nbsp;i=0&nbsp;then&nbsp;pathtmp&nbsp;=&nbsp;patharr(0)&nbsp;&amp;&nbsp;&quot;/&quot;&nbsp;else&nbsp;pathtmp&nbsp;=&nbsp;pathtmp&nbsp;&amp;&nbsp;patharr(i)&nbsp;&amp;&nbsp;&quot;/&quot;&nbsp;<br>&nbsp;&nbsp;&nbsp;cpath&nbsp;=&nbsp;left(pathtmp,len(pathtmp)-1)&nbsp;<br>&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;FileObject.FolderExists(cpath)&nbsp;then&nbsp;FileObject.CreateFolder(cpath)&nbsp;<br>&nbsp;&nbsp;&nbsp;next&nbsp;<br>&nbsp;&nbsp;&nbsp;set&nbsp;FileObject&nbsp;=&nbsp;nothing&nbsp;<br>&nbsp;&nbsp;&nbsp;if&nbsp;err.number&lt;&gt;0&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;CreateDIR&nbsp;=&nbsp;false&nbsp;<br>&nbsp;&nbsp;&nbsp;err.Clear&nbsp;<br>&nbsp;&nbsp;&nbsp;else&nbsp;<br>&nbsp;&nbsp;&nbsp;CreateDIR&nbsp;=&nbsp;true&nbsp;<br>&nbsp;&nbsp;&nbsp;end&nbsp;if&nbsp;<br>end&nbsp;function<br><br>&#39;/*<br>&#39;&nbsp;cookie编码加密<br>&#39;&nbsp;*/<br>Function&nbsp;CodeCookie(Str)<br>&nbsp;&nbsp;Dim&nbsp;i<br>&nbsp;&nbsp;Dim&nbsp;StrRtn<br>&nbsp;&nbsp;For&nbsp;i&nbsp;=&nbsp;Len(Str)&nbsp;To&nbsp;1&nbsp;Step&nbsp;-1<br>&nbsp;&nbsp;&nbsp;&nbsp;StrRtn&nbsp;=&nbsp;StrRtn&nbsp;&amp;&nbsp;AscW(Mid(Str,&nbsp;i,&nbsp;1))<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;(i&nbsp;&lt;&gt;&nbsp;1)&nbsp;Then&nbsp;StrRtn&nbsp;=&nbsp;StrRtn&nbsp;&amp;&nbsp;&quot;a&quot;<br>&nbsp;&nbsp;Next<br>&nbsp;&nbsp;CodeCookie&nbsp;=&nbsp;StrRtn<br>End&nbsp;Function<br>&#39;/*<br>&#39;cookie解密<br>&#39;&nbsp;*/&nbsp;<br>Function&nbsp;DecodeCookie(Str)<br>&nbsp;&nbsp;Dim&nbsp;i<br>&nbsp;&nbsp;Dim&nbsp;StrArr,&nbsp;StrRtn<br>&nbsp;&nbsp;StrArr&nbsp;=&nbsp;Split(Str,&nbsp;&quot;a&quot;)<br>&nbsp;&nbsp;For&nbsp;i&nbsp;=&nbsp;0&nbsp;To&nbsp;UBound(StrArr)<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;IsNumeric(StrArr(i))&nbsp;=&nbsp;True&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StrRtn&nbsp;=&nbsp;ChrW(StrArr(i))&nbsp;&amp;&nbsp;StrRtn<br>&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StrRtn&nbsp;=&nbsp;Str<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit&nbsp;Function<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;Next<br>&nbsp;&nbsp;DecodeCookie&nbsp;=&nbsp;StrRtn<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;设置Cookies<br>&#39;&nbsp;*&nbsp;vparameter:参数，val:值<br>&#39;&nbsp;*/<br>Function&nbsp;SetCookies(vparameter,val)<br>response.Cookies(vparameter)=val<br>response.Cookies(vparameter).Expires=dateadd(&quot;H&quot;,12,now())<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*　读取Cookies<br>&#39;&nbsp;*/<br>Function&nbsp;GetCookies(vparameter)<br>GetCookies=request.Cookies(vparameter)<br>End&nbsp;Function<br><br>&#39;============================================================安全过滤<br>&#39;/*<br>&#39;&nbsp;安全过滤<br>&#39;&nbsp;*/<br>Function&nbsp;SafeSql(Str,Flag)<br>SafeSql=Str<br>If&nbsp;Flag=1&nbsp;Then<br>&nbsp;&nbsp;If&nbsp;Not&nbsp;IsNumeric(SafeSql)&nbsp;Or&nbsp;Trim(SafeSql)=&quot;&quot;&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&#39;&nbsp;response.Write&nbsp;&quot;&lt;meta&nbsp;http-equiv=&quot;&quot;Refresh&quot;&quot;&nbsp;content=&quot;&quot;3;URL=index.asp&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;FIELDSET&nbsp;style=&#39;width:350px&#39;&gt;&lt;LEGEND&gt;描述&lt;/LEGEND&gt;&quot;<br>&nbsp;&nbsp;&nbsp;Response.Write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px&#39;&gt;参数错误,参数类型应为数值型。&lt;br&gt;当前值是：&quot;&amp;Str&amp;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/font&gt;&lt;/FIELDSET&gt;&quot;<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;br&gt;&lt;br&gt;&lt;div&nbsp;style=&#39;border:1px&nbsp;solid&nbsp;#CCCCCC;width:235px;height:25px;padding:5px;padding-left:15px;&#39;&gt;&lt;a&nbsp;href=http://www.hcj123.com&nbsp;target=_blank&nbsp;title=行业黄页门户&gt;好财经－给你最好的&lt;/a&gt;&lt;/div&gt;&quot;<br>&nbsp;&nbsp;&nbsp;Response.End<br>&nbsp;&nbsp;End&nbsp;If<br>ElseIf&nbsp;Flag=2&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=trim(Str)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;replace(Str,&nbsp;&quot;&gt;&quot;,&nbsp;&quot;&amp;gt;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;replace(Str,&nbsp;&quot;&lt;&quot;,&nbsp;&quot;&amp;lt;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str=Replace(Str,&quot;\&quot;,&quot;&amp;#92;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str=Replace(Str,&quot;--&quot;,&quot;&amp;#45;&amp;#45;&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;CHR(34),&nbsp;&quot;&amp;quot;&quot;)&nbsp;&#39;过滤&#39;&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;CHR(39),&nbsp;&quot;&amp;#39;&quot;)&nbsp;&#39;过滤&#39;<br>&nbsp;&nbsp;&nbsp;&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;CHR(13)&amp;CHR(10),&nbsp;&quot;&lt;BR&gt;&quot;)&nbsp;&#39;回车换行<br>&nbsp;&nbsp;&nbsp;Str&nbsp;=Replace(Str,CHR(42),&quot;&amp;#42;&quot;)&nbsp;&nbsp;&#39;“*”<br>&nbsp;&nbsp;&nbsp;Str&nbsp;=Replace(Str,CHR(44),&quot;&amp;#44;&quot;)&nbsp;&nbsp;&#39;“,”<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;select&quot;,&nbsp;&quot;select&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;join&quot;,&nbsp;&quot;join&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;union&quot;,&nbsp;&quot;union&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;where&quot;,&nbsp;&quot;where&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;insert&quot;,&nbsp;&quot;insert&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;delete&quot;,&nbsp;&quot;delete&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;update&quot;,&nbsp;&quot;update&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;like&quot;,&nbsp;&quot;like&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;drop&quot;,&nbsp;&quot;drop&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;create&quot;,&nbsp;&quot;create&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;modify&quot;,&nbsp;&quot;modify&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;rename&quot;,&nbsp;&quot;rename&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;alter&quot;,&nbsp;&quot;alter&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;cast&quot;,&nbsp;&quot;cast&quot;)<br>&nbsp;&nbsp;SafeSql=Str<br>Else<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;FIELDSET&nbsp;style=&#39;width:350px&#39;&gt;&lt;LEGEND&gt;描述&lt;/LEGEND&gt;&quot;<br>&nbsp;&nbsp;Response.Write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px&#39;&gt;参数错误SafeSql方法参数在1,2范围内&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;/font&gt;&lt;/FIELDSET&gt;&quot;<br>&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;br&gt;&lt;br&gt;&lt;div&nbsp;style=&#39;border:1px&nbsp;solid&nbsp;#CCCCCC;width:235px;height:25px;padding:5px;padding-left:15px;&#39;&gt;&lt;a&nbsp;href=http://www.hcj123.com&nbsp;target=_blank&nbsp;title=行业黄页门户&gt;好财经－给你最好的&lt;/a&gt;&lt;/div&gt;&quot;<br>&nbsp;&nbsp;Response.End<br>End&nbsp;If<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;HTML解码函数<br>&#39;&nbsp;*/<br>Function&nbsp;HTMLDecode(refStringing)&nbsp;<br>&nbsp;&nbsp;Dim&nbsp;fString<br>&nbsp;&nbsp;&nbsp;&nbsp;fString=refStringing&nbsp;<br>&nbsp;&nbsp;If&nbsp;Not&nbsp;IsNull(fString)&nbsp;Then&nbsp;<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;&amp;gt;&quot;,&nbsp;&quot;&gt;&quot;)&nbsp;<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;&amp;lt;&quot;,&nbsp;&quot;&lt;&quot;)&nbsp;<br>&nbsp;&nbsp;&nbsp;fString=Replace(fString,&quot;&amp;#92;&quot;,&quot;\&quot;)<br>&nbsp;&nbsp;&nbsp;fString=Replace(fString,&quot;&amp;#45;&amp;#45;&quot;,&quot;--&quot;)&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;&amp;quot;&quot;,CHR(34))&nbsp;&#39;还原&#39;&#39;&nbsp;<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;&amp;#39;&quot;,&nbsp;&quot;&#39;&quot;)&nbsp;&#39;还原&#39;<br>&#39;&nbsp;&nbsp;&nbsp;if&nbsp;instr(fString,CHR(13)&amp;CHR(10))&gt;0&nbsp;then<br>&#39;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;CHR(13)&amp;CHR(10),&nbsp;&quot;&lt;BR&gt;&quot;)&nbsp;&#39;回车换行&nbsp;<br>&#39;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;select&quot;,&nbsp;&quot;select&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;join&quot;,&nbsp;&quot;join&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;union&quot;,&nbsp;&quot;union&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;where&quot;,&nbsp;&quot;where&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;insert&quot;,&nbsp;&quot;insert&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;delete&quot;,&nbsp;&quot;delete&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;update&quot;,&nbsp;&quot;update&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;like&quot;,&nbsp;&quot;like&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;drop&quot;,&nbsp;&quot;drop&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;create&quot;,&nbsp;&quot;create&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;modify&quot;,&nbsp;&quot;modify&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;rename&quot;,&nbsp;&quot;rename&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;alter&quot;,&nbsp;&quot;alter&quot;)<br>&nbsp;&nbsp;&nbsp;fString&nbsp;=&nbsp;Replace(fString,&nbsp;&quot;cast&quot;,&nbsp;&quot;cast&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;HTMLDecode&nbsp;=&nbsp;fString<br>&nbsp;&nbsp;End&nbsp;If&nbsp;<br>End&nbsp;Function<br>&#39;/*<br>&#39;&nbsp;防注入<br>&#39;&nbsp;*/<br>Function&nbsp;FunSQL(Str)<br>If&nbsp;Isnull(Str)&nbsp;Then<br>FunSQL&nbsp;=&nbsp;&quot;&quot;<br>Exit&nbsp;Function&nbsp;<br>End&nbsp;If<br>&nbsp;&nbsp;Str=trim(Str)<br>Str&nbsp;=&nbsp;Replace(Str,Chr(0),&quot;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;&quot;&quot;&quot;,&nbsp;&quot;&amp;quot;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&quot;&lt;&quot;,&quot;&amp;lt;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&quot;&gt;&quot;,&quot;&amp;gt;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)&nbsp;<br>&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,CHR(42),&quot;&amp;#42;&quot;)&nbsp;&nbsp;&#39;“*”<br>&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,CHR(44),&quot;&amp;#44;&quot;)&nbsp;&nbsp;&#39;“,”<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;script&quot;,&nbsp;&quot;&amp;#115;cript&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;SCRIPT&quot;,&nbsp;&quot;&amp;#083;CRIPT&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;Script&quot;,&nbsp;&quot;&amp;#083;cript&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;script&quot;,&nbsp;&quot;&amp;#083;cript&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;object&quot;,&nbsp;&quot;&amp;#111;bject&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;OBJECT&quot;,&nbsp;&quot;&amp;#079;BJECT&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;Object&quot;,&nbsp;&quot;&amp;#079;bject&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;object&quot;,&nbsp;&quot;&amp;#079;bject&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;applet&quot;,&nbsp;&quot;&amp;#097;pplet&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;APPLET&quot;,&nbsp;&quot;&amp;#065;PPLET&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;Applet&quot;,&nbsp;&quot;&amp;#065;pplet&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;applet&quot;,&nbsp;&quot;&amp;#065;pplet&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;[&quot;,&nbsp;&quot;&amp;#091;&quot;)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;]&quot;,&nbsp;&quot;&amp;#093;&quot;)<br>&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;=&quot;,&nbsp;&quot;&amp;#061;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;&#39;&quot;,&nbsp;&quot;&#39;&#39;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;select&quot;,&nbsp;&quot;select&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;execute&quot;,&nbsp;&quot;&amp;#101xecute&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;exec&quot;,&nbsp;&quot;&amp;#101xec&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;join&quot;,&nbsp;&quot;join&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;union&quot;,&nbsp;&quot;union&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;where&quot;,&nbsp;&quot;where&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;insert&quot;,&nbsp;&quot;insert&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;delete&quot;,&nbsp;&quot;delete&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;update&quot;,&nbsp;&quot;update&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;like&quot;,&nbsp;&quot;like&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;drop&quot;,&nbsp;&quot;drop&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;create&quot;,&nbsp;&quot;create&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;rename&quot;,&nbsp;&quot;rename&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;count&quot;,&nbsp;&quot;co&amp;#117;nt&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;chr&quot;,&nbsp;&quot;c&amp;#104;r&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;mid&quot;,&nbsp;&quot;m&amp;#105;d&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;truncate&quot;,&nbsp;&quot;trunc&amp;#097;te&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;nchar&quot;,&nbsp;&quot;nch&amp;#097;r&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;char&quot;,&nbsp;&quot;ch&amp;#097;r&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;alter&quot;,&nbsp;&quot;alter&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;cast&quot;,&nbsp;&quot;cast&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;exists&quot;,&nbsp;&quot;e&amp;#120;ists&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,Chr(13),&quot;&lt;br&gt;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;*&quot;,&nbsp;&quot;＊&quot;)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;%&quot;,&nbsp;&quot;％&quot;)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;-&quot;,&nbsp;&quot;&amp;#8211;&quot;)<br>FunSQL&nbsp;=Replace(Str,&quot;&#39;&quot;,&quot;&amp;#39;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>End&nbsp;Function&nbsp;<br><br>&#39;/*<br>&#39;&nbsp;帖子内容过滤<br>&#39;&nbsp;*/&nbsp;<br>Function&nbsp;HtmlEditEncode(Str)<br>Str=trim(Str)<br>&nbsp;&nbsp;Str=Replace(Str,&quot;\&quot;,&quot;&amp;#92;&quot;)<br>&nbsp;&nbsp;Str=Replace(Str,&quot;&#39;&quot;,&quot;&amp;#39;&quot;)<br>&#39;&nbsp;&nbsp;Str&nbsp;=&nbsp;replace(Str,&nbsp;&quot;&gt;&quot;,&nbsp;&quot;&amp;gt;&quot;)<br>&#39;&nbsp;&nbsp;Str&nbsp;=&nbsp;replace(Str,&nbsp;&quot;&lt;&quot;,&nbsp;&quot;&amp;lt;&quot;)<br>&nbsp;&nbsp;&#39;Str&nbsp;=&nbsp;replace(Str,&nbsp;CHR(91),&nbsp;&quot;&amp;#91;&quot;)<br>&nbsp;&nbsp;vfilterKey=Split(urldecode(filterKey),&quot;,&quot;)<br>for&nbsp;vi=0&nbsp;to&nbsp;Ubound(vfilterKey)<br>Str=Replace(Str,vfilterKey(vi),&quot;*&quot;)<br>&nbsp;&nbsp;next<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;HtmlEditEncode=Str<br>End&nbsp;Function&nbsp;<br><br>&#39;UBB<br>Function&nbsp;BBCode(str)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[(\/|)(b|i|u|strike|center|marquee)\]&quot;,&quot;&lt;$1$2&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[COLOR=([^[]*)\]&quot;,&quot;&lt;FONT&nbsp;COLOR=$1&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[FONT=([^[]*)\]&quot;,&quot;&lt;FONT&nbsp;face=$1&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[SIZE=([0-9]*)\]&quot;,&quot;&lt;FONT&nbsp;size=$1&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[\/(SIZE|FONT|COLOR)\]&quot;,&quot;&lt;/FONT&gt;&quot;)<br>&nbsp;&nbsp;&#39;str=ReplaceText(str,&quot;\[URL\]([^[]*)&quot;,&quot;&lt;a&nbsp;target=_blank&nbsp;href=$1&gt;$1&quot;)<br>&nbsp;&nbsp;&#39;str=ReplaceText(str,&quot;\[URL=([^[]*)\]&quot;,&quot;&lt;a&nbsp;target=_blank&nbsp;href=$1&gt;&quot;)<br>&nbsp;&nbsp;&#39;str=ReplaceText(str,&quot;\[\/URL\]&quot;,&quot;&lt;/A&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[EMAIL\](\S+\@[^[]*)(\[\/EMAIL\])&quot;,&quot;&lt;a&nbsp;href=mailto:$1&gt;$1&lt;/a&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[IMG\]([^(&quot;&amp;CHR(34)&amp;&quot;|[|#)]*)(\[\/IMG\])&quot;,&quot;&lt;img&nbsp;border=0&nbsp;src=$1&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[quote\]&quot;,&quot;&lt;blockquote&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[quote&nbsp;user=&quot;&amp;CHR(34)&amp;&quot;([^[]*)&quot;&amp;CHR(34)&amp;&quot;\]&quot;,&quot;&lt;blockquote&gt;&nbsp;&lt;b&gt;以下是引用$1的发言&lt;/b&gt;&lt;br&gt;&quot;)<br>&nbsp;&nbsp;str=ReplaceText(str,&quot;\[\/quote\]&quot;,&quot;&lt;/blockquote&gt;&quot;)<br>&nbsp;&nbsp;if&nbsp;instr(str,&quot;:&amp;bq&quot;)&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;qi=1&nbsp;to&nbsp;16<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str=Replace(str,&quot;:&amp;bq&quot;&amp;qi&amp;&quot;;&quot;,&quot;&lt;img&nbsp;src=&#39;../../style/images/biaoqing/&quot;&amp;qi&amp;&quot;.gif&#39;&gt;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;next<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;BBCode=str<br>End&nbsp;Function<br><br>&#39;替换模块<br>Function&nbsp;ReplaceText(fString,patrn,replStr)<br>&nbsp;&nbsp;Set&nbsp;regEx&nbsp;=&nbsp;New&nbsp;RegExp&nbsp;&nbsp;&nbsp;&#39;&nbsp;建立正则表达式。<br>&nbsp;&nbsp;&nbsp;&nbsp;regEx.Pattern&nbsp;=&nbsp;patrn&nbsp;&#39;&nbsp;设置模式。<br>&nbsp;&nbsp;&nbsp;&nbsp;regEx.IgnoreCase&nbsp;=&nbsp;True&nbsp;&#39;&nbsp;设置是否区分大小写。<br>&nbsp;&nbsp;&nbsp;&nbsp;regEx.Global&nbsp;=&nbsp;True&nbsp;&#39;&nbsp;设置全局可用性。&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;ReplaceText&nbsp;=&nbsp;regEx.Replace(&quot;&quot;&amp;fString&amp;&quot;&quot;,&quot;&quot;&amp;replStr&amp;&quot;&quot;)&nbsp;&#39;&nbsp;作替换。<br>&nbsp;&nbsp;Set&nbsp;regEx=nothing<br>End&nbsp;Function<br><br>&#39;===============================================================<br>&#39;urldecode解码<br>function&nbsp;urldecode(encodestr)&nbsp;<br>&nbsp;&nbsp;newstr=&quot;&quot;&nbsp;<br>&nbsp;&nbsp;havechar=false&nbsp;<br>&nbsp;&nbsp;lastchar=&quot;&quot;&nbsp;<br>&nbsp;&nbsp;for&nbsp;i=1&nbsp;to&nbsp;len(encodestr)&nbsp;<br>&nbsp;&nbsp;char_c=mid(encodestr,i,1)&nbsp;<br>&nbsp;&nbsp;if&nbsp;char_c=&quot;+&quot;&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;newstr=newstr&nbsp;&amp;&nbsp;&quot;&nbsp;&quot;&nbsp;<br>&nbsp;&nbsp;elseif&nbsp;char_c=&quot;%&quot;&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;next_1_c=mid(encodestr,i+1,2)&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;next_1_num=cint(&quot;&amp;H&quot;&nbsp;&amp;&nbsp;next_1_c)&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;if&nbsp;havechar&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;havechar=false&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;newstr=newstr&nbsp;&amp;&nbsp;chr(cint(&quot;&amp;H&quot;&amp;lastchar&amp;next_1_c))&nbsp;<br>&nbsp;&nbsp;else&nbsp;<br>&nbsp;&nbsp;if&nbsp;abs(next_1_num)&lt;=127&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;newstr=newstr&nbsp;&amp;&nbsp;chr(next_1_num)&nbsp;<br>&nbsp;&nbsp;else&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;havechar=true&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;lastchar=next_1_c&nbsp;<br>&nbsp;&nbsp;end&nbsp;if&nbsp;<br>&nbsp;&nbsp;end&nbsp;if&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;i=i+2&nbsp;<br>&nbsp;&nbsp;else&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;newstr=newstr&amp;char_c&nbsp;<br>&nbsp;&nbsp;end&nbsp;if&nbsp;<br>&nbsp;&nbsp;next&nbsp;<br>&nbsp;&nbsp;urldecode=newstr&nbsp;<br>end&nbsp;function&nbsp;<br><br>&#39;/*<br>&#39;&nbsp;去掉HTML标记(正规表达式)<br>&#39;&nbsp;*/<br>Function&nbsp;Replacehtml(Textstr)<br>&nbsp;&nbsp;Dim&nbsp;Str,re<br>&nbsp;&nbsp;Str=Textstr<br>&nbsp;&nbsp;Set&nbsp;re=new&nbsp;RegExp<br>&nbsp;&nbsp;&nbsp;&nbsp;re.IgnoreCase&nbsp;=True<br>&nbsp;&nbsp;&nbsp;&nbsp;re.Global=True<br>&nbsp;&nbsp;&nbsp;&nbsp;re.Pattern=&quot;&lt;(.[^&gt;]*)&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Str=re.Replace(Str,&nbsp;&quot;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Set&nbsp;Re=Nothing<br>&nbsp;&nbsp;&nbsp;&nbsp;Str=Replace(Str,&quot;&lt;script&quot;,&quot;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Replacehtml=Str<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*去掉链接代码,有时候失效<br>&#39;&nbsp;*/<br>function&nbsp;MV_link(str)<br>&nbsp;&nbsp;dim&nbsp;re<br>&nbsp;&nbsp;set&nbsp;re=new&nbsp;RegExp<br>&nbsp;&nbsp;&nbsp;&nbsp;re.global=true<br>&nbsp;&nbsp;&nbsp;&nbsp;re.ignorecase=true<br>&nbsp;&nbsp;&nbsp;&nbsp;re.pattern=&quot;&lt;a&nbsp;[^&gt;]*&gt;([^&lt;]*)&lt;/a&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;str=re.Replace(str,&quot;$1&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;MV_link=str<br>&nbsp;&nbsp;set&nbsp;re=nothing<br>end&nbsp;function<br><br>&#39;=========================================================<br>&#39;**&nbsp;函数：RemoveHref&nbsp;方法1<br>&#39;**&nbsp;作用：正则表达式去除字符串中所有的超级链接<br>&#39;=========================================================<br>Function&nbsp;RemoveHref(HTMLstr)<br>Set&nbsp;ra&nbsp;=&nbsp;New&nbsp;RegExp<br>ra.IgnoreCase&nbsp;=&nbsp;True<br>ra.Global&nbsp;=&nbsp;True<br>ra.Pattern&nbsp;=&nbsp;&quot;&lt;a[^&gt;]+&gt;(.+?)&lt;\/a&gt;&quot;<br>RemoveHref=&nbsp;ra.replace(HTMLstr,&quot;$1&quot;)<br>End&nbsp;Function<br><br>&#39;=========================================================<br>&#39;**&nbsp;函数：RemoveHref　方法2<br>&#39;**&nbsp;作用：去除字符串中所有的超级链接<br>&#39;=========================================================<br>Function&nbsp;RemoveHref_2(HTMLstr)<br>Dim&nbsp;n,str1,str2,str3,str4<br>HTMLstr&nbsp;=&nbsp;Lcase(HTMLstr)<br>For&nbsp;n=1&nbsp;to&nbsp;Ubound(Split(HTMLstr,&quot;&lt;a&quot;))<br>str1&nbsp;=&nbsp;Instr(HTMLstr,&quot;&lt;a&quot;)<br>str2&nbsp;=&nbsp;Instr(str1,HTMLstr,&quot;&gt;&quot;)<br>HTMLstr&nbsp;=&nbsp;left(HTMLstr,str1-1)&amp;right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))<br>HTMLstr&nbsp;=&nbsp;replace&nbsp;(HTMLstr,&quot;&lt;/a&gt;&quot;,&quot;&quot;)<br>Next<br>RemoveHref_2=HTMLstr<br>End&nbsp;Function<br><br>&#39;=========================================================<br>&#39;**&nbsp;函数：RemoveHref<br>&#39;**&nbsp;作用：去除字符串中所有的图片<br>&#39;=========================================================<br>Function&nbsp;RemoveImg(HTMLstr)<br>Dim&nbsp;n,str1,str2,str3,str4<br>HTMLstr&nbsp;=&nbsp;Lcase(HTMLstr)<br>For&nbsp;n=1&nbsp;to&nbsp;Ubound(Split(HTMLstr,&quot;&lt;img&quot;))<br>str1&nbsp;=&nbsp;Instr(HTMLstr,&quot;&lt;img&quot;)<br>str2&nbsp;=&nbsp;Instr(str1,HTMLstr,&quot;&gt;&quot;)<br>HTMLstr&nbsp;=&nbsp;left(HTMLstr,str1-1)&amp;right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))<br>Next<br>RemoveImg=HTMLstr<br>End&nbsp;Function<br>&#39;=========================================================<br>&#39;**&nbsp;函数：RepScript<br>&#39;**&nbsp;作用：去除字符串中所有的script<br>&#39;=========================================================<br>Function&nbsp;RepScript(HTMLstr)<br>Dim&nbsp;n,str1,str2,str3,str4<br>HTMLstr&nbsp;=&nbsp;Lcase(HTMLstr)<br>For&nbsp;n=1&nbsp;to&nbsp;Ubound(Split(HTMLstr,&quot;&lt;script&quot;))<br>str1&nbsp;=&nbsp;Instr(HTMLstr,&quot;&lt;script&quot;)<br>str2&nbsp;=&nbsp;Instr(str1,HTMLstr,&quot;&lt;/script&gt;&quot;)<br>HTMLstr&nbsp;=&nbsp;left(HTMLstr,str1-1)&amp;right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))<br>Next<br>HTMLstr=Replace(HTMLstr,&quot;/script&gt;&quot;,&quot;&quot;)<br>RepScript=HTMLstr<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;得到IP<br>&#39;&nbsp;*/<br>function&nbsp;GetIp()<br>&nbsp;&nbsp;&nbsp;dim&nbsp;getclientip<br>&nbsp;&nbsp;&nbsp;getclientip&nbsp;=&nbsp;Request.ServerVariables(&quot;HTTP_X_FORWARDED_FOR&quot;)<br>&nbsp;&nbsp;&nbsp;If&nbsp;getclientip&nbsp;=&nbsp;&quot;&quot;&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getclientip&nbsp;=&nbsp;Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;GetIp&nbsp;=&nbsp;getclientip<br>End&nbsp;Function&nbsp;<br><br>&#39;/*<br>&#39;&nbsp;检查元素是否在数组中<br>&#39;&nbsp;*/<br>Function&nbsp;inarr(arr,e)<br>&nbsp;&nbsp;Dim&nbsp;j<br>&nbsp;&nbsp;inarr&nbsp;=&nbsp;false<br>&nbsp;&nbsp;If&nbsp;Not&nbsp;IsArray(arr)&nbsp;Then&nbsp;Exit&nbsp;Function<br>&nbsp;&nbsp;For&nbsp;j&nbsp;=&nbsp;0&nbsp;To&nbsp;UBound(arr)<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;e&nbsp;=&nbsp;arr(j)&nbsp;Then&nbsp;inarr&nbsp;=&nbsp;true&nbsp;:&nbsp;Exit&nbsp;For<br>&nbsp;&nbsp;Next<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;截取指定长度的字符串<br>&#39;&nbsp;*&nbsp;str&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;——&nbsp;被截取的字符串<br>&#39;&nbsp;*&nbsp;strlen&nbsp;&nbsp;——&nbsp;要截取的长度<br>&#39;&nbsp;*/<br>Function&nbsp;CutStr(Str,StrLen)<br>&nbsp;&nbsp;Dim&nbsp;l,t,c,i<br>&nbsp;&nbsp;l=Len(str)<br>&nbsp;&nbsp;t=0<br>&nbsp;&nbsp;For&nbsp;i=1&nbsp;To&nbsp;l<br>&nbsp;&nbsp;&nbsp;&nbsp;c=AscW(Mid(str,i,1))<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;c&lt;0&nbsp;Or&nbsp;c&gt;255&nbsp;Then&nbsp;t=t+2&nbsp;Else&nbsp;t=t+1<br>&nbsp;&nbsp;&nbsp;&nbsp;IF&nbsp;t&gt;=StrLen&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CutStr=left(Str,i)&amp;&quot;...&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit&nbsp;For<br>&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CutStr=Str<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;Next<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;日期转换<br>&#39;&nbsp;*/<br>Function&nbsp;DateToStr(DateTime,ShowType)&nbsp;&#39;日期转换函数<br>&nbsp;&nbsp;Dim&nbsp;DateMonth,DateDay,DateHour,DateMinute<br>&nbsp;&nbsp;DateMonth=Month(DateTime)<br>&nbsp;&nbsp;DateDay=Day(DateTime)<br>&nbsp;&nbsp;DateHour=Hour(DateTime)<br>&nbsp;&nbsp;DateMinute=Minute(DateTime)<br>&nbsp;&nbsp;If&nbsp;Len(DateMonth)&lt;2&nbsp;Then&nbsp;DateMonth=&quot;0&quot;&amp;DateMonth<br>&nbsp;&nbsp;If&nbsp;Len(DateDay)&lt;2&nbsp;Then&nbsp;DateDay=&quot;0&quot;&amp;DateDay<br>&nbsp;&nbsp;Select&nbsp;Case&nbsp;ShowType<br>&nbsp;&nbsp;Case&nbsp;&quot;YMD&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;Year(DateTime)&amp;&quot;年&quot;&amp;DateMonth&amp;&quot;月&quot;&amp;DateDay&amp;&quot;日&quot;<br>&nbsp;&nbsp;Case&nbsp;&quot;Y-m-d&quot;&nbsp;&#39;2006-09-19&nbsp;年－月－日<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=Year(DateTime)&amp;&quot;-&quot;&amp;DateMonth&amp;&quot;-&quot;&amp;DateDay<br>&nbsp;&nbsp;Case&nbsp;&quot;M-D-Y&quot;&nbsp;&#39;09-19-2006&nbsp;月－日－年<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateMonth&amp;&quot;-&quot;&amp;DateDay&amp;&quot;-&quot;&amp;Year(DateTime)&nbsp;&nbsp;<br>&nbsp;&nbsp;Case&nbsp;&quot;Y/M/D&quot;&nbsp;&#39;2006/09/19&nbsp;年/月/日<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;Year(DateTime)&amp;&quot;/&quot;&amp;DateMonth&amp;&quot;/&quot;&amp;DateDay<br>&nbsp;&nbsp;Case&nbsp;&quot;M/D/Y&quot;&nbsp;&#39;09/19/2006&nbsp;月/日/年<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateMonth&amp;&quot;/&quot;&amp;DateDay&amp;&quot;/&quot;&amp;Year(DateTime)<br>&nbsp;&nbsp;Case&nbsp;&quot;D/M/Y&quot;&nbsp;&#39;19/09/2006&nbsp;日/月/年<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateDay&amp;&quot;/&quot;&amp;DateMonth&amp;&quot;/&quot;&amp;Year(DateTime)<br>&nbsp;&nbsp;Case&nbsp;&quot;M.D.Y&quot;&nbsp;&#39;09.19.2006&nbsp;月.日.年<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateMonth&amp;&quot;.&quot;&amp;DateDay&amp;&quot;.&quot;&amp;Year(DateTime)<br>&nbsp;&nbsp;Case&nbsp;&quot;Y.M.D&quot;&nbsp;&#39;2006.09.19&nbsp;年.月.日<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;Year(DateTime)&amp;&quot;.&quot;&amp;DateMonth&amp;&quot;.&quot;&amp;DateDay<br>&nbsp;&nbsp;Case&nbsp;&quot;M-D&nbsp;H:M&quot;&nbsp;&#39;10-1&nbsp;15:2<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateMonth&amp;&quot;-&quot;&amp;DateDay&amp;&quot;&nbsp;&quot;&amp;DateHour&amp;&quot;:&quot;&amp;DateMinute&amp;&quot;&quot;&nbsp;<br>&nbsp;&nbsp;Case&nbsp;&quot;MD&quot;&nbsp;&#39;09月19日&nbsp;月日<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateMonth&amp;&quot;月&quot;&amp;DateDay&amp;&quot;日&quot;<br>&nbsp;&nbsp;Case&nbsp;&quot;DH&quot;&nbsp;&#39;19日17时&nbsp;日时<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateDay&amp;&quot;日&quot;&amp;DateHour&amp;&quot;时&quot;<br>&nbsp;&nbsp;Case&nbsp;&quot;DH.&quot;&nbsp;&#39;19日17点&nbsp;日点<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateDay&amp;&quot;日&quot;&amp;DateHour&amp;&quot;点&quot;<br>&nbsp;&nbsp;Case&nbsp;&quot;HMin&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateHour&amp;&quot;时&quot;&amp;DateMinute&amp;&quot;分&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;Case&nbsp;&quot;H:Min&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;DateHour&amp;&quot;:&quot;&amp;DateMinute<br>&nbsp;&nbsp;Case&nbsp;&quot;Y/M/D&nbsp;H:M&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr&nbsp;=&nbsp;Year(DateTime)&amp;&quot;/&quot;&amp;DateMonth&amp;&quot;/&quot;&amp;DateDay&amp;&quot;&nbsp;&quot;&amp;DateHour&amp;&quot;:&quot;&amp;DateMinute<br>&nbsp;&nbsp;Case&nbsp;&quot;Y-m-d&nbsp;H:I&nbsp;A&quot;&nbsp;&#39;2006-09-19&nbsp;05:37&nbsp;PM<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;DateAMPM<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;DateHour&gt;12&nbsp;Then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DateHour=DateHour-12<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DateAMPM=&quot;PM&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DateHour=DateHour<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DateAMPM=&quot;AM&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateHour)&lt;2&nbsp;Then&nbsp;DateHour=&quot;0&quot;&amp;DateHour&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateMinute)&lt;2&nbsp;Then&nbsp;DateMinute=&quot;0&quot;&amp;DateMinute<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=Year(DateTime)&amp;&quot;-&quot;&amp;DateMonth&amp;&quot;-&quot;&amp;DateDay&amp;&quot;&nbsp;&quot;&amp;DateHour&amp;&quot;:&quot;&amp;DateMinute&amp;&quot;&nbsp;&quot;&amp;DateAMPM<br>&nbsp;&nbsp;Case&nbsp;&quot;Y-m-d&nbsp;H:I:S&quot;&nbsp;&#39;2006-09-19&nbsp;17:37:53<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;DateSecond<br>&nbsp;&nbsp;&nbsp;&nbsp;DateSecond=Second(DateTime)<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateHour)&lt;2&nbsp;Then&nbsp;DateHour=&quot;0&quot;&amp;DateHour&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateMinute)&lt;2&nbsp;Then&nbsp;DateMinute=&quot;0&quot;&amp;DateMinute<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateSecond)&lt;2&nbsp;Then&nbsp;DateSecond=&quot;0&quot;&amp;DateSecond<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=Year(DateTime)&amp;&quot;-&quot;&amp;DateMonth&amp;&quot;-&quot;&amp;DateDay&amp;&quot;&nbsp;&quot;&amp;DateHour&amp;&quot;:&quot;&amp;DateMinute&amp;&quot;:&quot;&amp;DateSecond<br>&nbsp;&nbsp;Case&nbsp;&quot;m/d&nbsp;H:I&quot;&nbsp;&#39;07/02&nbsp;19:02<br>&nbsp;&nbsp;&nbsp;&nbsp;DateSecond=Second(DateTime)<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateHour)&lt;2&nbsp;Then&nbsp;DateHour=&quot;0&quot;&amp;DateHour&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateMinute)&lt;2&nbsp;Then&nbsp;DateMinute=&quot;0&quot;&amp;DateMinute<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateSecond)&lt;2&nbsp;Then&nbsp;DateSecond=&quot;0&quot;&amp;DateSecond<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=DateMonth&amp;&quot;/&quot;&amp;DateDay&amp;&quot;&nbsp;&quot;&amp;DateHour&amp;&quot;:&quot;&amp;DateMinute<br>&nbsp;&nbsp;Case&nbsp;&quot;YmdHIS&quot;&nbsp;&#39;20060919173753<br>&nbsp;&nbsp;&nbsp;&nbsp;DateSecond=Second(DateTime)<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateHour)&lt;2&nbsp;Then&nbsp;DateHour=&quot;0&quot;&amp;DateHour&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateMinute)&lt;2&nbsp;Then&nbsp;DateMinute=&quot;0&quot;&amp;DateMinute<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateSecond)&lt;2&nbsp;Then&nbsp;DateSecond=&quot;0&quot;&amp;DateSecond<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=Year(DateTime)&amp;DateMonth&amp;DateDay&amp;DateHour&amp;DateMinute&amp;DateSecond&nbsp;&nbsp;<br>&nbsp;&nbsp;Case&nbsp;&quot;ym&quot;&nbsp;&#39;0609年月<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=Right(Year(DateTime),2)&amp;DateMonth<br>&nbsp;&nbsp;Case&nbsp;&quot;d&quot;&nbsp;&#39;19日<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=DateDay<br>&nbsp;&nbsp;Case&nbsp;Else&nbsp;&#39;2006-09-19&nbsp;17:37<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateHour)&lt;2&nbsp;Then&nbsp;DateHour=&quot;0&quot;&amp;DateHour<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Len(DateMinute)&lt;2&nbsp;Then&nbsp;DateMinute=&quot;0&quot;&amp;DateMinute<br>&nbsp;&nbsp;&nbsp;&nbsp;DateToStr=Year(DateTime)&amp;&quot;-&quot;&amp;DateMonth&amp;&quot;-&quot;&amp;DateDay&amp;&quot;&nbsp;&quot;&amp;DateHour&amp;&quot;:&quot;&amp;DateMinute<br>&nbsp;&nbsp;End&nbsp;Select<br>End&nbsp;Function<br>&#39;/*<br>&#39;&nbsp;随机英文+数字<br>&#39;&nbsp;*/<br>Function&nbsp;GetRamCode(f_number)<br>&nbsp;&nbsp;Randomize<br>&nbsp;&nbsp;Dim&nbsp;f_Randchar,f_Randchararr,f_RandLen,f_Randomizecode,f_iR<br>&nbsp;&nbsp;f_Randchar=&quot;0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z&quot;<br>&nbsp;&nbsp;f_Randchararr=split(f_Randchar,&quot;,&quot;)<br>&nbsp;&nbsp;f_RandLen=f_number&nbsp;&#39;定义密码的长度或者是位数<br>&nbsp;&nbsp;for&nbsp;f_iR=1&nbsp;to&nbsp;f_RandLen<br>&nbsp;&nbsp;&nbsp;&nbsp;f_Randomizecode=f_Randomizecode&amp;f_Randchararr(Int((21*Rnd)))<br>&nbsp;&nbsp;next<br>&nbsp;&nbsp;GetRamCode&nbsp;=&nbsp;f_Randomizecode<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;分页函数<br>&#39;&nbsp;iRecordCount记录总数,iRecordCount每页记录数<br>&#39;&nbsp;iPageCount总页数,Filegs处理页<br>&#39;&nbsp;*&nbsp;/<br>Function&nbsp;pagination(iRecordCount,iPageSize,iPageCount,Filegs)<br>Dim&nbsp;wzpage,wzpagecount,pagenum,arrValue(2)<br>dim&nbsp;beginpage,endpage&nbsp;&#39;两者之间<br>&nbsp;&nbsp;If&nbsp;Len(Request.QueryString(&quot;page&quot;))&lt;&gt;0&nbsp;Then<br>&nbsp;&nbsp;&nbsp;wzpage&nbsp;=&nbsp;clng(Request.QueryString(&quot;page&quot;))&nbsp;&#39;当前页<br>&nbsp;&nbsp;&nbsp;Else&nbsp;<br>&nbsp;&nbsp;&nbsp;wzpage&nbsp;=1<br>&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;If&nbsp;wzpage&nbsp;&lt;=&nbsp;0&nbsp;Then&nbsp;wzpage&nbsp;=1<br>&nbsp;&nbsp;if&nbsp;(wzpage-4&gt;=1)&nbsp;then<br>&nbsp;&nbsp;&nbsp;beginpage=wzpage-4<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;beginpage=1<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;(wzpage+4&lt;=iPageCount)&nbsp;then<br>&nbsp;&nbsp;&nbsp;endpage=wzpage+4<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;endpage=iPageCount<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;beginpage=1&nbsp;and&nbsp;iPageCount&gt;=9&nbsp;then&nbsp;&#39;保持有9页选择<br>&nbsp;&nbsp;&nbsp;beginpage=1:endpage=9<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;endpage=iPageCount&nbsp;and&nbsp;iPageCount&gt;=9&nbsp;then&nbsp;&#39;保持有9页选择<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beginpage=endpage-8<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;wzpage&gt;=2&nbsp;then<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;wzpage-1&amp;&quot;&quot;&quot;&nbsp;title=&quot;&quot;上一页&quot;&quot;&gt;上一页&lt;/a&gt;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&#39;+----------------出现首页数字<br>&nbsp;&nbsp;if&nbsp;beginpage=&gt;2&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&quot;page=1&quot;&quot;&nbsp;title=&quot;&quot;首页&quot;&quot;&gt;[1..]&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;for&nbsp;beginpage=beginpage&nbsp;to&nbsp;endpage<br>&nbsp;&nbsp;&nbsp;If&nbsp;beginpage&nbsp;=&nbsp;wzpage&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;font&nbsp;color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;[&quot;&amp;&nbsp;wzpage&nbsp;&amp;&quot;]&nbsp;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;/font&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;&nbsp;beginpage&nbsp;&amp;&quot;&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;[&quot;&amp;&nbsp;beginpage&nbsp;&amp;&quot;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;&nbsp;If&nbsp;beginpage&nbsp;&gt;=&nbsp;iPageCount&nbsp;Then&nbsp;Exit&nbsp;For<br>&nbsp;&nbsp;next<br>&nbsp;&nbsp;&#39;+----------------出现尾页数字<br>&nbsp;&nbsp;if&nbsp;endpage&lt;iPageCount&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;&nbsp;iPageCount&nbsp;&amp;&quot;&quot;&quot;&nbsp;title=&quot;&quot;末页&quot;&quot;&gt;[..&quot;&amp;iPageCount&amp;&quot;]&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;wzpage&lt;iPageCount&nbsp;then<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;&nbsp;wzpage+1&nbsp;&amp;&quot;&quot;&quot;&nbsp;title=&quot;&quot;下一页&quot;&quot;&gt;下一页&lt;/a&gt;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;arrValue(1)&nbsp;=&nbsp;&quot;&nbsp;当前第&quot;&amp;wzpage&amp;&quot;页&nbsp;&quot;&amp;iPageSize&amp;&quot;条/页&nbsp;共&quot;&amp;iPageCount&amp;&quot;页/&quot;&amp;iRecordCount&amp;&quot;条记录&quot;<br>&nbsp;&nbsp;pagination=arrValue<br>End&nbsp;Function&nbsp;<br><br>&#39;/*<br>&#39;&nbsp;分页函数(用于无刷新)<br>&#39;&nbsp;iRecordCount:记录总数,iPageSize:每页记录数<br>&#39;&nbsp;iPageCount:总页数,Filegs:处理页<br>&#39;&nbsp;inowpage：当前页<br>&#39;&nbsp;*&nbsp;/<br>Function&nbsp;pagination_ajax(iRecordCount,iPageSize,iPageCount,inowpage,Filegs)<br>Dim&nbsp;wzpage,wzpagecount,pagenum,arrValue(2)<br>dim&nbsp;beginpage,endpage&nbsp;&#39;两者之间<br>&nbsp;&nbsp;If&nbsp;Len(inowpage)&lt;&gt;0&nbsp;Then<br>&nbsp;&nbsp;&nbsp;wzpage&nbsp;=&nbsp;clng(inowpage)&nbsp;&#39;当前页<br>&nbsp;&nbsp;&nbsp;Else&nbsp;<br>&nbsp;&nbsp;&nbsp;wzpage&nbsp;=1<br>&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;If&nbsp;wzpage&nbsp;&lt;=&nbsp;0&nbsp;Then&nbsp;wzpage&nbsp;=1<br>&nbsp;&nbsp;if&nbsp;(wzpage-4&gt;=1)&nbsp;then<br>&nbsp;&nbsp;&nbsp;beginpage=wzpage-4<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;beginpage=1<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;(wzpage+4&lt;=iPageCount)&nbsp;then<br>&nbsp;&nbsp;&nbsp;endpage=wzpage+4<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;endpage=iPageCount<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;beginpage=1&nbsp;and&nbsp;iPageCount&gt;=9&nbsp;then&nbsp;&#39;保持有9页选择<br>&nbsp;&nbsp;&nbsp;beginpage=1:endpage=9<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;endpage=iPageCount&nbsp;and&nbsp;iPageCount&gt;=9&nbsp;then&nbsp;&#39;保持有9页选择<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beginpage=endpage-8<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;wzpage&gt;=2&nbsp;then<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;a&nbsp;href=#_p&nbsp;onclick=&quot;&quot;showRdPL(&#39;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;wzpage-1&amp;&quot;&#39;)&quot;&quot;&nbsp;title=&quot;&quot;上一页&quot;&quot;&gt;上一页&lt;/a&gt;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&#39;+----------------出现首页数字<br>&nbsp;&nbsp;if&nbsp;beginpage=&gt;2&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=#_p&nbsp;onclick=&quot;&quot;showRdPL(&#39;&quot;&amp;Filegs&amp;&quot;page=1&#39;)&quot;&quot;&nbsp;title=&quot;&quot;首页&quot;&quot;&gt;[1..]&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;for&nbsp;beginpage=beginpage&nbsp;to&nbsp;endpage<br>&nbsp;&nbsp;&nbsp;If&nbsp;beginpage&nbsp;=&nbsp;wzpage&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;font&nbsp;color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;[&quot;&amp;&nbsp;wzpage&nbsp;&amp;&quot;]&nbsp;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;/font&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=#_p&nbsp;onclick=&quot;&quot;showRdPL(&#39;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;&nbsp;beginpage&nbsp;&amp;&quot;&#39;)&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;[&quot;&amp;&nbsp;beginpage&nbsp;&amp;&quot;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;&nbsp;If&nbsp;beginpage&nbsp;&gt;=&nbsp;iPageCount&nbsp;Then&nbsp;Exit&nbsp;For<br>&nbsp;&nbsp;next<br>&nbsp;&nbsp;&#39;+----------------出现尾页数字<br>&nbsp;&nbsp;if&nbsp;endpage&lt;iPageCount&nbsp;then&nbsp;<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=#_p&nbsp;onclick=&quot;&quot;showRdPL(&#39;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;&nbsp;iPageCount&nbsp;&amp;&quot;&#39;)&quot;&quot;&nbsp;title=&quot;&quot;末页&quot;&quot;&gt;[..&quot;&amp;iPageCount&amp;&quot;]&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;if&nbsp;wzpage&lt;iPageCount&nbsp;then<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;a&nbsp;href=#_p&nbsp;onclick=&quot;&quot;showRdPL(&#39;&quot;&amp;Filegs&amp;&quot;page=&quot;&amp;&nbsp;wzpage+1&nbsp;&amp;&quot;&#39;)&quot;&quot;&nbsp;title=&quot;&quot;下一页&quot;&quot;&gt;下一页&lt;/a&gt;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;arrValue(1)&nbsp;=&nbsp;&quot;&nbsp;&lt;b&gt;总数&quot;&amp;iRecordCount&amp;&quot;&lt;/b&gt;&quot;<br>&nbsp;&nbsp;pagination_ajax=arrValue<br>End&nbsp;Function&nbsp;<br><br>&#39;/*<br>&#39;&nbsp;分页函数生成html<br>&#39;&nbsp;iRecordCount记录总数,iPageSize每页记录数<br>&#39;&nbsp;iPageCount总页数,Filegs处理页,nowPage:当前页<br>&#39;&nbsp;*&nbsp;/<br>Function&nbsp;pagination_html(iRecordCount,iPageSize,iPageCount,Filegs,nowPage)<br>Dim&nbsp;wzpage,wzpagecount,pagenum,arrValue(2)<br>dim&nbsp;beginpage,endpage&nbsp;&#39;两者之间<br>If&nbsp;Len(nowPage)&lt;&gt;0&nbsp;Then<br>&nbsp;&nbsp;&nbsp;wzpage&nbsp;=&nbsp;clng(nowPage)&nbsp;&#39;当前页<br>&nbsp;&nbsp;&nbsp;Else&nbsp;<br>&nbsp;&nbsp;&nbsp;wzpage&nbsp;=1<br>End&nbsp;If<br>If&nbsp;wzpage&nbsp;&lt;=&nbsp;0&nbsp;Then&nbsp;wzpage&nbsp;=1<br>if&nbsp;(wzpage-4&gt;=1)&nbsp;then<br>beginpage=wzpage-4<br>else<br>beginpage=1<br>end&nbsp;if<br>if&nbsp;(wzpage+4&lt;=iPageCount)&nbsp;then<br>endpage=wzpage+4<br>else<br>endpage=iPageCount<br>end&nbsp;if<br>if&nbsp;beginpage=1&nbsp;and&nbsp;iPageCount&gt;=9&nbsp;then&nbsp;&#39;保持有9页选择<br>beginpage=1:endpage=9<br>end&nbsp;if<br>if&nbsp;endpage=iPageCount&nbsp;and&nbsp;iPageCount&gt;=9&nbsp;then&nbsp;&#39;保持有9页选择<br>&nbsp;&nbsp;&nbsp;beginpage=endpage-8<br>end&nbsp;if<br>if&nbsp;wzpage&gt;=2&nbsp;then<br>&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;wzpage-1&amp;&quot;.html&quot;&quot;&nbsp;title=&quot;&quot;上一页&quot;&quot;&gt;&amp;laquo;上一页&lt;/a&gt;&quot;<br>end&nbsp;if<br>&#39;+----------------出现首页数字<br>if&nbsp;beginpage=&gt;2&nbsp;then&nbsp;<br>arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&quot;1.html&quot;&quot;&nbsp;title=&quot;&quot;首页&quot;&quot;&gt;[1..]&lt;/a&gt;&nbsp;&quot;<br>end&nbsp;if<br>for&nbsp;beginpage=beginpage&nbsp;to&nbsp;endpage<br>&nbsp;&nbsp;&nbsp;If&nbsp;beginpage&nbsp;=&nbsp;wzpage&nbsp;Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;font&nbsp;color=&quot;&quot;#ff0000&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;[&quot;&amp;&nbsp;wzpage&nbsp;&amp;&quot;]&nbsp;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;/font&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;beginpage&nbsp;&amp;&quot;.html&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;[&quot;&amp;&nbsp;beginpage&nbsp;&amp;&quot;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrValue(0)=arrValue(0)&amp;&quot;&lt;/a&gt;&nbsp;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If<br>&nbsp;&nbsp;&nbsp;If&nbsp;beginpage&nbsp;&gt;=&nbsp;iPageCount&nbsp;Then&nbsp;Exit&nbsp;For<br>next<br>&#39;+----------------出现尾页数字<br>if&nbsp;endpage&lt;iPageCount&nbsp;then&nbsp;<br>arrValue(0)=arrValue(0)&amp;&quot;&nbsp;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;iPageCount&nbsp;&amp;&quot;.html&quot;&quot;&nbsp;title=&quot;&quot;末页&quot;&quot;&gt;[..&quot;&amp;iPageCount&amp;&quot;]&lt;/a&gt;&nbsp;&quot;<br>end&nbsp;if<br>if&nbsp;wzpage&lt;iPageCount&nbsp;then<br>arrValue(0)=arrValue(0)&amp;&quot;&lt;a&nbsp;href=&quot;&quot;&quot;&amp;Filegs&amp;&nbsp;wzpage+1&nbsp;&amp;&quot;.html&quot;&quot;&nbsp;title=&quot;&quot;下一页&quot;&quot;&gt;下页更精彩&amp;raquo;&lt;/a&gt;&quot;<br>end&nbsp;if<br><br>arrValue(1)&nbsp;=&nbsp;&quot;&nbsp;当前第&quot;&amp;wzpage&amp;&quot;页&nbsp;&quot;&amp;iPageSize&amp;&quot;条/页&nbsp;共&quot;&amp;iPageCount&amp;&quot;页/&quot;&amp;iRecordCount&amp;&quot;条记录&quot;<br>pagination_html=arrValue<br>End&nbsp;Function&nbsp;<br><br>&#39;/*<br>&#39;&nbsp;文章内容加上{{page}}作为某处的分页标识<br>&#39;&nbsp;长文章指定{{page}}分页<br>&#39;&nbsp;--pid：文章的ID<br>&#39;&nbsp;--ntext:文章的内容<br>&#39;&nbsp;--lfile：连接文件<br>&#39;&nbsp;*/<br>Function&nbsp;opage(pid,ntext,lfile)<br>dim&nbsp;temp_text,startStr,anum<br>temp_text=ntext<br>&nbsp;&nbsp;&nbsp;listPage=&quot;{{page}}&quot;&nbsp;&#39;分布符<br>if&nbsp;instr(temp_text,listPage)&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;anum=split(temp_text,listPage)<br>&nbsp;&nbsp;&nbsp;page=request.QueryString(&quot;page&quot;)<br>&nbsp;&nbsp;&nbsp;if&nbsp;page=&quot;&quot;&nbsp;or&nbsp;page=0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page=1<br>&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page=Clng(page)<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i=1&nbsp;to&nbsp;ubound(anum)+1&nbsp;&nbsp;&nbsp;&#39;分页开始<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;i=page&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;i=1&nbsp;then&nbsp;&#39;特别处理page=1的情况<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numPage=numPage&amp;&quot;[&lt;A&nbsp;href=&quot;&amp;lfile&amp;&quot;?pid=&quot;&amp;pid&amp;&quot;&gt;&lt;font&nbsp;color=red&gt;1&lt;/font&gt;&lt;/a&gt;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numPage=numPage&amp;&quot;[&lt;A&nbsp;href=&quot;&amp;lfile&amp;&quot;?pid=&quot;&amp;pid&amp;&quot;&amp;page=&quot;&amp;i&amp;&quot;&gt;&lt;font&nbsp;color=red&gt;&quot;&amp;i&amp;&quot;&lt;/font&gt;&lt;/a&gt;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;i=1&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numPage=numPage&amp;&quot;[&lt;A&nbsp;href=&quot;&amp;lfile&amp;&quot;?pid=&quot;&amp;pid&amp;&quot;&gt;1&lt;/a&gt;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numPage=numPage&amp;&quot;[&lt;A&nbsp;href=&quot;&amp;lfile&amp;&quot;?pid=&quot;&amp;pid&amp;&quot;&amp;page=&quot;&amp;i&amp;&quot;&gt;&quot;&amp;i&amp;&quot;&lt;/a&gt;]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;page&gt;ubound(anum)+1&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page=ubound(anum)+1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp_text=anum(page-1)&amp;&quot;&lt;div&nbsp;align=center&gt;{{page}}&lt;/div&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp_text=replace(temp_text,&quot;{{page}}&quot;,numPage)<br>&nbsp;&nbsp;&nbsp;end&nbsp;if&nbsp;&nbsp;&nbsp;<br>opage=temp_text<br>End&nbsp;Function<br>&#39;/*<br>&#39;&nbsp;*写入特定行<br>&#39;&nbsp;*使用方法，在文件14行加入内容<br>&#39;&nbsp;*Call&nbsp;FSOlinewrite(&quot;/Common/aspcodes/Variable.asp&quot;,14,&quot;annouce=&quot;&quot;&quot;&amp;request(&quot;annouce&quot;)&amp;&quot;&quot;&quot;&quot;)<br>&#39;&nbsp;*/<br>Function&nbsp;FSOlinewrite(filename,lineNum,Linecontent)<br>&nbsp;&nbsp;if&nbsp;linenum&nbsp;&lt;&nbsp;1&nbsp;then&nbsp;exit&nbsp;function<br>&nbsp;&nbsp;dim&nbsp;fso,f,temparray,tempCnt<br>&nbsp;&nbsp;set&nbsp;fso&nbsp;=&nbsp;server.CreateObject(&quot;scripting.filesystemobject&quot;)<br>&nbsp;&nbsp;if&nbsp;not&nbsp;fso.fileExists(server.mappath(filename))&nbsp;then&nbsp;exit&nbsp;function<br>&nbsp;&nbsp;set&nbsp;f&nbsp;=&nbsp;fso.opentextfile(server.mappath(filename),1)<br>&nbsp;&nbsp;if&nbsp;not&nbsp;f.AtEndofStream&nbsp;then<br>&nbsp;&nbsp;tempcnt&nbsp;=&nbsp;f.readall<br>&nbsp;&nbsp;f.close<br>&nbsp;&nbsp;temparray&nbsp;=&nbsp;split(tempcnt,chr(13)&amp;chr(10))<br>&nbsp;&nbsp;if&nbsp;lineNum&gt;ubound(temparray)+1&nbsp;then<br>&nbsp;&nbsp;exit&nbsp;function<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&#39;temparray(lineNum-1)&nbsp;=&nbsp;temparray(lineNum-1)&amp;chr(13)&amp;chr(10)&amp;lineContent&nbsp;&#39;保留原内容<br>&nbsp;&nbsp;temparray(lineNum-1)&nbsp;=&nbsp;lineContent&nbsp;&#39;不保留原内容<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;tempcnt&nbsp;=&nbsp;join(temparray,chr(13)&amp;chr(10))<br>&nbsp;&nbsp;set&nbsp;f&nbsp;=&nbsp;fso.createtextfile(server.mappath(filename),true)<br>&nbsp;&nbsp;f.write&nbsp;tempcnt<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;f.close<br>&nbsp;&nbsp;set&nbsp;f&nbsp;=&nbsp;nothing<br>End&nbsp;Function<br>&#39;&#39;此函数返回下拉列表字符串，arrayname为传入的数组名称,&nbsp;arrayvalue为传入的数组值，sltname为此下拉列表的名称，sltclass为此下拉列表的样式，sltvalue为此下拉列表默认选择的值&nbsp;<br><br>Function&nbsp;writeselect(arrayname,arrayvalue,sltname,sltclass,sltvalue)&nbsp;<br>dim&nbsp;slt,i&nbsp;<br>slt=&quot;&lt;select&nbsp;name=&quot;&nbsp;&amp;&nbsp;sltname&nbsp;&amp;&nbsp;&quot;&nbsp;class=&quot;&nbsp;&amp;&nbsp;sltclass&nbsp;&amp;&nbsp;&quot;&gt;&quot;&nbsp;<br>for&nbsp;i=0&nbsp;to&nbsp;ubound(arrayname)&nbsp;<br>if&nbsp;sltvalue&lt;&gt;&quot;&quot;&nbsp;and&nbsp;trim(sltvalue)=trim(arrayvalue(i))&nbsp;then<br>slt=slt&nbsp;&amp;&nbsp;&quot;&lt;option&nbsp;value=&quot;&nbsp;&amp;&nbsp;arrayvalue(i)&nbsp;&amp;&quot;&nbsp;selected&gt;&quot;&nbsp;&amp;&nbsp;arrayname(i)&nbsp;&amp;&nbsp;&quot;&lt;/option&gt;&quot;&nbsp;<br>else<br>slt=slt&nbsp;&amp;&nbsp;&quot;&lt;option&nbsp;value=&quot;&nbsp;&amp;&nbsp;arrayvalue(i)&nbsp;&amp;&quot;&gt;&quot;&nbsp;&amp;&nbsp;arrayname(i)&nbsp;&amp;&nbsp;&quot;&lt;/option&gt;&quot;&nbsp;<br>end&nbsp;if<br>next&nbsp;<br>slt=slt&nbsp;&amp;&nbsp;&quot;&lt;/select&gt;&quot;&nbsp;<br>writeselect=slt&nbsp;<br>End&nbsp;function<br>&#39;+--------------------------------------<br>&#39;&nbsp;函数功能：用户权限<br>&#39;&nbsp;参数：pstr当前有效值<br>&#39;+--------------------------------------<br>Function&nbsp;limits(pstr)<br>dim&nbsp;tpstr,tresult<br>tpstr=pstr&nbsp;<br>&nbsp;&nbsp;&nbsp;if&nbsp;Instr(Session(&quot;czy_right&quot;),tpstr)&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;tresult=true<br>&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;tresult=false<br>&nbsp;&nbsp;&nbsp;end&nbsp;if<br>limits=tresult<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;获取当前Url参数的函数&nbsp;　<br>&#39;&nbsp;*/<br>Function&nbsp;GetUrl()&nbsp;<br>&nbsp;&nbsp;Dim&nbsp;ScriptAddress,M_ItemUrl,&nbsp;M_item&nbsp;<br>&nbsp;&nbsp;ScriptAddress&nbsp;=&nbsp;&quot;http://&quot;&amp;request.ServerVariables(&quot;SERVER_NAME&quot;)&amp;CStr(Request.ServerVariables(&quot;SCRIPT_NAME&quot;))&nbsp;&#39;取得当前地址&nbsp;<br>&nbsp;&nbsp;M_ItemUrl&nbsp;=&nbsp;&quot;&quot;&nbsp;<br>&nbsp;&nbsp;If&nbsp;(Request.QueryString&nbsp;&lt;&gt;&nbsp;&quot;&quot;)&nbsp;Then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;ScriptAddress&nbsp;=&nbsp;ScriptAddress&nbsp;&amp;&nbsp;&quot;?&quot;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;Each&nbsp;M_item&nbsp;In&nbsp;Request.QueryString&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&#39;如果页面传递参数是用page变量，那么判断一下page是否已经使用，避免重复！<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;InStr(&quot;pavge&quot;,M_Item)=0&nbsp;Then&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;M_ItemUrl&nbsp;=&nbsp;M_ItemUrl&nbsp;&amp;&nbsp;M_Item&nbsp;&amp;&quot;=&quot;&amp;&nbsp;Server.URLEncode(Request.QueryString(&quot;&quot;&amp;M_Item&amp;&quot;&quot;))&nbsp;&amp;&nbsp;&quot;&amp;&quot;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Next&nbsp;<br>&nbsp;&nbsp;end&nbsp;if&nbsp;<br>&nbsp;&nbsp;GetUrl&nbsp;=&nbsp;ScriptAddress&nbsp;&amp;&nbsp;M_ItemUrl<br>&nbsp;&nbsp;if&nbsp;instr(1,GetUrl,&quot;?&quot;,1)&lt;1&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;GetUrl=GetUrl&amp;&quot;?&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>End&nbsp;Function&nbsp;<br><br>&#39;过滤关键字<br>&#39;str原字符串<br>&#39;keylist以|分隔的要过滤关键字<br>Function&nbsp;ReplaceKey(str,keylist)<br>dim&nbsp;tKey,tkeylist<br>tkeylist=Split(keylist,&quot;|&quot;)<br>for&nbsp;i=0&nbsp;to&nbsp;Ubound(tkeylist)<br>tKey=replace(str,tkeylist(i),&quot;&quot;)<br>&nbsp;&nbsp;&nbsp;str=tKey<br>next<br>&#39;大写再转换一次<br>tkeylist=Split(UCase(keylist),&quot;|&quot;)<br>for&nbsp;i=0&nbsp;to&nbsp;Ubound(tkeylist)<br>tKey=replace(str,tkeylist(i),&quot;&quot;)<br>&nbsp;&nbsp;&nbsp;str=tKey<br>next&nbsp;<br>ReplaceKey=tKey<br>end&nbsp;function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;页脚信息<br>&#39;&nbsp;*/<br>Function&nbsp;endpageMsn()<br>endpageMsn=&quot;&lt;script&nbsp;src=&#39;&quot;&amp;Website&amp;&quot;/ShowWebcount.asp&#39;&gt;&lt;/script&gt;&lt;/font&gt;&quot;<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;网站维护<br>&#39;&nbsp;*/<br>Sub&nbsp;Webunkeep()<br>&nbsp;&nbsp;if&nbsp;webIsopen=0&nbsp;then<br>&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;&lt;font&nbsp;style=&#39;font-size:14px;line-height:20px&#39;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;Response.Write&nbsp;&quot;Diggcms系统温馨提示：网站正在维护中……,请稍候访问！&lt;/font&gt;&quot;<br>&nbsp;&nbsp;&nbsp;Response.End<br>&nbsp;&nbsp;end&nbsp;if<br>End&nbsp;Sub<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;验证码　<br>&#39;&nbsp;*/<br>Function&nbsp;GetCode()<br>Randomize<br>nowRand=Int((10*Rnd))<br>Verification_code=Split(&quot;涨,一日千里,yes,Dig,GOOD,拉升,打板,帅,COOL,明日,成&quot;,&quot;,&quot;)<br>GetCode=Verification_code(nowRand)<br>end&nbsp;Function<br>&#39;+-----------------<br>&#39;&nbsp;显示验证码<br>&#39;+-----------------<br>Sub&nbsp;ShowCode()<br>response.Write&nbsp;&quot;&lt;script&gt;&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;function&nbsp;copyTxt(str){&quot;&amp;VBCRLF&nbsp;<br>response.Write&nbsp;&quot;var&nbsp;clipBoardContent=&quot;&quot;&quot;&quot;;&quot;&amp;VBCRLF&nbsp;<br>response.Write&nbsp;&quot;&nbsp;clipBoardContent+=str;&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;&nbsp;window.clipboardData.setData(&#39;Text&#39;,clipBoardContent);&quot;&amp;VBCRLF&nbsp;<br>response.Write&nbsp;&quot;&nbsp;&nbsp;alert(&#39;验证码复制成功！&#39;);&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;}&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;&lt;/script&gt;&quot;&amp;VBCRLF<br>Randomize<br>showRand=Int((9999999*Rnd))<br>nowgetcode=getcode()<br>response.Cookies(&quot;hao123.com&quot;)=nowgetcode<br>response.Write&nbsp;&quot;&lt;div&nbsp;title=&#39;点击复制验证码&#39;&nbsp;onclick=&#39;copyTxt(&quot;&quot;&quot;&amp;request.Cookies(&quot;hao123.com&quot;)&amp;&quot;&quot;&quot;)&#39;&nbsp;style=&#39;padding:2px;background-color:#F7F7F7;width:60px;text-align:center;border:1px&nbsp;dashed&nbsp;#2BA239;cursor:pointer&#39;&nbsp;id=&#39;&quot;&amp;showRand&amp;&quot;&#39;&gt;&quot;&amp;request.Cookies(&quot;hao123.com&quot;)&amp;&quot;&lt;/div&gt;&quot;<br>end&nbsp;sub<br>&#39;+---------------<br>&#39;&nbsp;存在再显示<br>&#39;+---------------<br>Sub&nbsp;ShowCodeOver()<br>response.Write&nbsp;&quot;&lt;script&gt;&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;function&nbsp;copyTxt(str){&quot;&amp;VBCRLF&nbsp;<br>response.Write&nbsp;&quot;var&nbsp;clipBoardContent=&quot;&quot;&quot;&quot;;&quot;&amp;VBCRLF&nbsp;<br>response.Write&nbsp;&quot;&nbsp;clipBoardContent+=str;&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;&nbsp;window.clipboardData.setData(&#39;Text&#39;,clipBoardContent);&quot;&amp;VBCRLF&nbsp;<br>response.Write&nbsp;&quot;&nbsp;&nbsp;alert(&#39;验证码复制成功！&#39;);&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;}&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;&lt;/script&gt;&quot;&amp;VBCRLF<br>response.Write&nbsp;&quot;&lt;div&nbsp;title=&#39;点击复制验证码&#39;&nbsp;onclick=&#39;copyTxt(&quot;&quot;&quot;&amp;request.Cookies(&quot;hao123.com&quot;)&amp;&quot;&quot;&quot;)&#39;&nbsp;style=&#39;padding:2px;background-color:#F7F7F7;width:8px;border:1px&nbsp;dashed&nbsp;#2BA239;cursor:pointer&#39;&nbsp;id=&#39;&quot;&amp;showRand&amp;&quot;&#39;&gt;&quot;&amp;request.Cookies(&quot;hao123.com&quot;)&amp;&quot;&lt;/div&gt;&quot;<br>End&nbsp;Sub<br><br>&#39;防刷新<br>sub&nbsp;refreshtime()<br>if&nbsp;DateDiff(&quot;s&quot;,Session(&quot;RefreshTime&quot;),Now())&lt;iRefreshTime&nbsp;then<br>Call&nbsp;FunMsg(&quot;#&quot;,&quot;温馨提示：请不要在&quot;&amp;iRefreshTime&amp;&quot;秒内快速发帖\n　　　　　还剩&quot;&amp;iRefreshTime-DateDiff(&quot;s&quot;,Session(&quot;RefreshTime&quot;),now())&amp;&quot;秒&quot;)<br>&nbsp;&nbsp;&nbsp;Response.End<br>end&nbsp;if<br>Session(&quot;RefreshTime&quot;)=Now()<br>end&nbsp;sub<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;读取模板文件内容<br>&#39;&nbsp;*/<br>Function&nbsp;Readtemplate(vdir,val)<br>dim&nbsp;p_template<br>&nbsp;&nbsp;set&nbsp;FSO&nbsp;=&nbsp;createobject(&quot;Scripting.FileSystemObject&quot;)<br>&nbsp;&nbsp;if&nbsp;FSO.FileExists(server.mappath(vdir&amp;TemplateDir&nbsp;&amp;&quot;\&quot;&amp;&nbsp;val))&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;oFile&nbsp;=&nbsp;FSO.OpenTextFile(server.mappath(vdir&amp;TemplateDir&nbsp;&amp;&quot;\&quot;&amp;&nbsp;val),&nbsp;1)<br>&nbsp;&nbsp;&nbsp;&nbsp;p_template&nbsp;=&nbsp;oFile.ReadAll<br>&nbsp;&nbsp;&nbsp;&nbsp;oFile.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;oFile&nbsp;=&nbsp;nothing<br>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;vdir&lt;&gt;&quot;&quot;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.Write&nbsp;&quot;更新&quot;&amp;val&amp;&quot;完成&lt;br&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;response.write&nbsp;&quot;&lt;b&gt;ASPTemplate&nbsp;Error:&nbsp;File&nbsp;[&quot;&nbsp;&amp;&nbsp;val&nbsp;&amp;&nbsp;&quot;]&nbsp;does&nbsp;not&nbsp;exists!&lt;/b&gt;&lt;br&gt;&quot;<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;set&nbsp;FSO&nbsp;=&nbsp;nothing<br>&nbsp;&nbsp;Readtemplate=p_template<br>end&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;设置帖子列表小图<br>&#39;&nbsp;*/<br>Function&nbsp;SetImgWH(IMGPath,MaxW,MaxH)<br>On&nbsp;Error&nbsp;Resume&nbsp;Next<br>&nbsp;&nbsp;if&nbsp;instr(Lcase(IMGPath),&quot;http://&quot;)&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;IMGPath=IMGPath:W=MaxW:H=MaxH<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;Set&nbsp;PP&nbsp;=&nbsp;New&nbsp;ImgWHInfo&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;W&nbsp;=&nbsp;PP.imgW(lcase(Server.Mappath(IMGPath)))&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;H&nbsp;=&nbsp;PP.imgH(lcase(Server.Mappath(IMGPath)))&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Set&nbsp;pp&nbsp;=&nbsp;Nothing&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;W&gt;MaxW&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H=H*MaxW/W<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;W=MaxW<br>&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;H&nbsp;&gt;MaxH&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;W=W*MaxH/H<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H=MaxH<br>&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;&nbsp;&nbsp;pp=null<br>&nbsp;&nbsp;end&nbsp;if<br>&nbsp;&nbsp;SetImgWH&nbsp;=&nbsp;&quot;src=&#39;&quot;&amp;IMGPath&amp;&quot;&#39;&nbsp;width=&#39;&quot;&amp;int(W)&amp;&quot;&#39;&nbsp;height=&#39;&quot;&amp;int(H)&amp;&quot;&#39;&nbsp;&quot;<br>End&nbsp;Function<br><br>&#39;/*<br>&#39;&nbsp;*&nbsp;更新模板缓存<br>&#39;&nbsp;*/<br>Sub&nbsp;updatetemplate()<br>if&nbsp;Application(&quot;diggcms_index&quot;)=&quot;&quot;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;Application.Lock<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_index&quot;)=Readtemplate(&quot;&quot;,&quot;index.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_top&quot;)=Readtemplate(&quot;&quot;,&quot;top.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_top_list&quot;)=Readtemplate(&quot;&quot;,&quot;top_list.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_search&quot;)=Readtemplate(&quot;&quot;,&quot;search.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_register&quot;)=Readtemplate(&quot;&quot;,&quot;Register.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_mlist&quot;)=Readtemplate(&quot;&quot;,&quot;mlist.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_login&quot;)=Readtemplate(&quot;&quot;,&quot;login.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_list_tyle2&quot;)=Readtemplate(&quot;&quot;,&quot;list_tyle2.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_list_tyle1&quot;)=Readtemplate(&quot;&quot;,&quot;list_tyle1.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_list&quot;)=Readtemplate(&quot;&quot;,&quot;list.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_html&quot;)=Readtemplate(&quot;&quot;,&quot;html.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_end&quot;)=Readtemplate(&quot;&quot;,&quot;end.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application(&quot;diggcms_channel&quot;)=Readtemplate(&quot;&quot;,&quot;channel.htm&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Application.UnLock&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&#39;response.Write&nbsp;&quot;成功&quot;<br>end&nbsp;if&nbsp;&nbsp;<br>End&nbsp;Sub<br>%&gt;&nbsp;<br>]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1001</link><title><![CDATA[ASP防止挂马攻击和SQL参数注入攻击函数]]></title><author>glenluo</author><category>编程技术</category><pubDate>2010-3-12 18:57:35</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1001</guid><description><![CDATA[由于最近黑客猖獗，对于病毒和黑客没办法做到100%的防备，但至少也要提高网站的安全性能！在这里给出ASP防止挂马攻击和SQL参数注入攻击函数，希望大家做好补丁！<br><br>Function&nbsp;FunSQL(Str)<br>If&nbsp;Isnull(Str)&nbsp;Then<br>FunSQL&nbsp;=&nbsp;&quot;&quot;<br>Exit&nbsp;Function&nbsp;<br>End&nbsp;If<br>&nbsp;&nbsp;Str=trim(Str)<br>Str&nbsp;=&nbsp;Replace(Str,Chr(0),&quot;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;&quot;&quot;&quot;,&nbsp;&quot;&amp;quot;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&quot;&lt;&quot;,&quot;&amp;lt;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&quot;&gt;&quot;,&quot;&amp;gt;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)&nbsp;<br>&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,CHR(42),&quot;&amp;#42;&quot;)&nbsp;&nbsp;&#39;“*”<br>&nbsp;&nbsp;Str&nbsp;=&nbsp;Replace(Str,CHR(44),&quot;&amp;#44;&quot;)&nbsp;&nbsp;&#39;“,”<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;script&quot;,&nbsp;&quot;&amp;#115;cript&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;SCRIPT&quot;,&nbsp;&quot;&amp;#083;CRIPT&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;Script&quot;,&nbsp;&quot;&amp;#083;cript&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;script&quot;,&nbsp;&quot;&amp;#083;cript&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;object&quot;,&nbsp;&quot;&amp;#111;bject&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;OBJECT&quot;,&nbsp;&quot;&amp;#079;BJECT&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;Object&quot;,&nbsp;&quot;&amp;#079;bject&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;object&quot;,&nbsp;&quot;&amp;#079;bject&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;applet&quot;,&nbsp;&quot;&amp;#097;pplet&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;APPLET&quot;,&nbsp;&quot;&amp;#065;PPLET&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;Applet&quot;,&nbsp;&quot;&amp;#065;pplet&quot;,&nbsp;1,&nbsp;-1,&nbsp;0)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;applet&quot;,&nbsp;&quot;&amp;#065;pplet&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;[&quot;,&nbsp;&quot;&amp;#091;&quot;)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;]&quot;,&nbsp;&quot;&amp;#093;&quot;)<br>&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;=&quot;,&nbsp;&quot;&amp;#061;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;&#39;&quot;,&nbsp;&quot;&#39;&#39;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;select&quot;,&nbsp;&quot;select&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;execute&quot;,&nbsp;&quot;&amp;#101xecute&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;exec&quot;,&nbsp;&quot;&amp;#101xec&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;join&quot;,&nbsp;&quot;join&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;union&quot;,&nbsp;&quot;union&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;where&quot;,&nbsp;&quot;where&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;insert&quot;,&nbsp;&quot;insert&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;delete&quot;,&nbsp;&quot;delete&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;update&quot;,&nbsp;&quot;update&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;like&quot;,&nbsp;&quot;like&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;drop&quot;,&nbsp;&quot;drop&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;create&quot;,&nbsp;&quot;create&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;rename&quot;,&nbsp;&quot;rename&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;count&quot;,&nbsp;&quot;co&amp;#117;nt&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;chr&quot;,&nbsp;&quot;c&amp;#104;r&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;mid&quot;,&nbsp;&quot;m&amp;#105;d&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;truncate&quot;,&nbsp;&quot;trunc&amp;#097;te&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;nchar&quot;,&nbsp;&quot;nch&amp;#097;r&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;char&quot;,&nbsp;&quot;ch&amp;#097;r&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;alter&quot;,&nbsp;&quot;alter&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;cast&quot;,&nbsp;&quot;cast&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;exists&quot;,&nbsp;&quot;e&amp;#120;ists&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>Str&nbsp;=&nbsp;Replace(Str,Chr(13),&quot;&lt;br&gt;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>&#39;&nbsp;Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;*&quot;,&nbsp;&quot;＊&quot;)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;%&quot;,&nbsp;&quot;％&quot;)<br>Str&nbsp;=&nbsp;Replace(Str,&nbsp;&quot;-&quot;,&nbsp;&quot;&amp;#8211;&quot;)<br>FunSQL&nbsp;=Replace(Str,&quot;&#39;&quot;,&quot;&amp;#39;&quot;,&nbsp;1,&nbsp;-1,&nbsp;1)<br>End&nbsp;Function<br><br>这里对&nbsp;script&nbsp;的大小写也进行了区分过滤，基本可以解决。我们可以再数据的存储和调用的时候进行过滤判断！]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=1000</link><title><![CDATA[ASP将人民币小写转换成大写]]></title><author>glenluo</author><category>编程技术</category><pubDate>2010-3-12 18:55:24</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=1000</guid><description><![CDATA[下面是具体实现的函数，调用方法就是&nbsp;rmb(这里放的是你要转换的金额数字)<br>Function&nbsp;rmb(num)&nbsp;<br><br><br>num&nbsp;=&nbsp;FormatNumber(num,&nbsp;2)&nbsp;<br><br><br>Dim&nbsp;numList,rmbList,numLen,numChar,numstr,n,n1,n2,hz&nbsp;<br><br>numList&nbsp;=&nbsp;&quot;零壹贰叁肆伍陆柒捌玖&quot;&nbsp;<br><br>rmbList&nbsp;=&nbsp;&quot;分角元拾佰仟万拾佰仟亿拾佰仟万&quot;&nbsp;<br><br>If&nbsp;num&nbsp;&gt;&nbsp;9999999999999.99&nbsp;Then&nbsp;<br><br>rmb&nbsp;=&nbsp;&quot;超出范围的人民币值&quot;&nbsp;<br><br>Exit&nbsp;Function&nbsp;<br><br>End&nbsp;If&nbsp;<br><br>numstr&nbsp;=&nbsp;CStr(num&nbsp;*&nbsp;100)&nbsp;<br><br>numLen&nbsp;=&nbsp;Len(numstr)&nbsp;<br><br>n&nbsp;=&nbsp;1&nbsp;<br><br>Do&nbsp;While&nbsp;n&nbsp;&lt;=&nbsp;numLen&nbsp;<br><br>numChar&nbsp;=&nbsp;CInt(Mid(numstr,&nbsp;n,&nbsp;1))&nbsp;<br><br>n1&nbsp;=&nbsp;Mid(numList,&nbsp;numChar&nbsp;+&nbsp;1,&nbsp;1)&nbsp;<br><br>n2&nbsp;=&nbsp;Mid(rmbList,&nbsp;numLen&nbsp;-&nbsp;n&nbsp;+&nbsp;1,&nbsp;1)&nbsp;<br><br>If&nbsp;Not&nbsp;n1&nbsp;=&nbsp;&quot;零&quot;&nbsp;Then&nbsp;<br><br>hz&nbsp;=&nbsp;hz&nbsp;+&nbsp;CStr(n1)&nbsp;+&nbsp;CStr(n2)&nbsp;<br><br>Else&nbsp;<br><br>If&nbsp;n2&nbsp;=&nbsp;&quot;亿&quot;&nbsp;Or&nbsp;n2&nbsp;=&nbsp;&quot;万&quot;&nbsp;Or&nbsp;n2&nbsp;=&nbsp;&quot;元&quot;&nbsp;Or&nbsp;n1&nbsp;=&nbsp;&quot;零&quot;&nbsp;Then&nbsp;<br><br>Do&nbsp;While&nbsp;Right(hz,&nbsp;1)&nbsp;=&nbsp;&quot;零&quot;&nbsp;<br><br>hz&nbsp;=&nbsp;Left(hz,&nbsp;Len(hz)&nbsp;-&nbsp;1)&nbsp;<br><br>Loop&nbsp;<br><br>End&nbsp;If&nbsp;<br><br>If&nbsp;(n2&nbsp;=&nbsp;&quot;亿&quot;&nbsp;Or&nbsp;(n2&nbsp;=&nbsp;&quot;万&quot;&nbsp;And&nbsp;Right(hz,&nbsp;1)&nbsp;&lt;&gt;&nbsp;&quot;亿&quot;)&nbsp;Or&nbsp;n2&nbsp;=&nbsp;&quot;元&quot;)&nbsp;Then&nbsp;<br><br>hz&nbsp;=&nbsp;hz&nbsp;+&nbsp;CStr(n2)&nbsp;<br><br>Else&nbsp;<br><br>If&nbsp;Left(Right(hz,&nbsp;2),&nbsp;1)&nbsp;=&nbsp;&quot;零&quot;&nbsp;Or&nbsp;Right(hz,&nbsp;1)&nbsp;&lt;&gt;&nbsp;&quot;亿&quot;&nbsp;Then&nbsp;<br><br>hz&nbsp;=&nbsp;hz&nbsp;+&nbsp;n1&nbsp;<br><br>End&nbsp;If&nbsp;<br><br>End&nbsp;If&nbsp;<br><br>End&nbsp;If&nbsp;<br><br>n&nbsp;=&nbsp;n&nbsp;+&nbsp;1&nbsp;<br><br>Loop&nbsp;<br><br>Do&nbsp;While&nbsp;Right(hz,&nbsp;1)&nbsp;=&nbsp;&quot;零&quot;&nbsp;<br><br>hz&nbsp;=&nbsp;Left(hz,&nbsp;Len(hz)&nbsp;-&nbsp;1)&nbsp;<br><br>Loop&nbsp;<br><br>If&nbsp;Right(hz,&nbsp;1)&nbsp;=&nbsp;&quot;元&quot;&nbsp;Then&nbsp;<br><br>hz&nbsp;=&nbsp;hz&nbsp;+&nbsp;&quot;整&quot;&nbsp;<br><br>End&nbsp;If&nbsp;<br><br>rmb&nbsp;=&nbsp;hz&nbsp;<br><br>End&nbsp;Function&nbsp;<br>]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=999</link><title><![CDATA[cookie欺骗的实现]]></title><author>glenluo</author><category>编程技术</category><pubDate>2010-3-12 18:48:13</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=999</guid><description><![CDATA[正如我们所知道的，在网络词汇中，cookie是一个特殊的信息，虽然只是服务器存于用户计算机上的一个文本文件，但由于其内容的不寻常性(与服务器有一定的互交性，且常会存储用户名，甚至口令，或是其它一些敏感信息，例如在江湖或是一些社区中，常会用cookie来保存用户集分，等级等等)。因而成为一些高手关注的对像，借此来取得特殊权限，甚至攻克整个网站。本人出些拙作，以java&nbsp;script中对cookie的应用，来说初步说明cookie欺骗的实现过程及具体应用。&nbsp;<br>　　&nbsp;<br>　　一、cookie的建立&nbsp;<br>　　&nbsp;<br>　　在讲如何建立cookie之前，我们先来了解一下cookie的基本格式：&nbsp;<br>　　&nbsp;<br>　　cookiename+cookievalue;expire=expirationdategmt;path=urlpath;domain=sitedomain&nbsp;<br>　　&nbsp;<br>　　其中各项以;分开，首先是指定cookie的名称，并为其赋值。接下来分别是cookie的有效期，url路径以及域名，在这几项中，除了第一项以外，其它部分均为可先项。<br>　　下面我们来看一段代码，了解一下cookie究竟是怎样建立的：&nbsp;<br>　　&nbsp;<br>　　&lt;HTML&gt;&nbsp;<br>　　&lt;HEAD&gt;&nbsp;<br>　　&lt;TITLE&gt;Set&nbsp;a&nbsp;cookie&nbsp;based&nbsp;on&nbsp;a&nbsp;form&lt;/TITLE&gt;&nbsp;<br>　　&lt;SCRIPT&nbsp;LANGUAGE=&quot;java&nbsp;script&quot;&nbsp;TYPE=&quot;TEXT/java&nbsp;script&quot;&gt;&nbsp;<br>　　&lt;!--&nbsp;Hide&nbsp;script&nbsp;from&nbsp;older&nbsp;browsers&nbsp;<br>　　&nbsp;<br>　　expireDate&nbsp;=&nbsp;new&nbsp;Date&nbsp;<br>　　expireDate.setMonth(expireDate.getMonth()+6)&nbsp;<br>　　&nbsp;<br>　　userName&nbsp;=&nbsp;&quot;&quot;&nbsp;<br>　　if&nbsp;(documents&nbsp;.cookie&nbsp;!=&nbsp;&quot;&quot;)&nbsp;{&nbsp;<br>　　userName&nbsp;=&nbsp;documents&nbsp;.cookie.split(&quot;=&quot;)[1]&nbsp;<br>　　}&nbsp;<br>　　&nbsp;<br>　　function&nbsp;setCookie()&nbsp;{&nbsp;<br>　　userName&nbsp;=&nbsp;document.myform.nameField.value&nbsp;<br>　　documents&nbsp;.cookie&nbsp;=&nbsp;&quot;userName=&quot;+userName+&quot;;expires=&quot;&nbsp;+&nbsp;expireDate.toGMTString()&nbsp;<br>　　}&nbsp;<br>　　&nbsp;<br>　　//&nbsp;End&nbsp;hiding&nbsp;script&nbsp;--&gt;&nbsp;<br>　　&lt;/SCRIPT&gt;&nbsp;<br>　　&lt;/HEAD&gt;&nbsp;<br>　　&lt;BODY&nbsp;BGCOLOR=&quot;WHITE&quot;&nbsp;onLoad=&quot;document.myform.nameField.value&nbsp;=&nbsp;userName&quot;&gt;&nbsp;<br>　　&lt;form&nbsp;NAME=&quot;myform&quot;&gt;&nbsp;<br>　　&lt;H1&gt;Enter&nbsp;your&nbsp;name:&lt;INPUT&nbsp;TYPE=&quot;TEXT&quot;&nbsp;NAME=&quot;nameField&quot;&nbsp;onBlur=&quot;setCookie()&quot;&gt;&lt;/H1&gt;&nbsp;<br>　　&lt;/form&gt;&nbsp;<br>　　&lt;/BODY&gt;&nbsp;<br>　　&lt;/HTML&gt;&nbsp;<br>　　这是一锻简单的建立cookie的脚本。&nbsp;<br>　　&nbsp;<br>　　1，&lt;SCRIPT&nbsp;LANGUAGE=&quot;java&nbsp;script&quot;&nbsp;TYPE=&quot;TEXT/java&nbsp;script&quot;&gt;&nbsp;<br>　　&nbsp;<br>　　脚本开始的标记，由此一句告诉浏览器以下将是java&nbsp;script.&nbsp;<br>　　&nbsp;<br>　　2,&lt;!--&nbsp;Hide&nbsp;script&nbsp;from&nbsp;older&nbsp;browsers&nbsp;<br>　　&nbsp;<br>　　为了防止浏览器不能识别脚本，而让浏览器误以为是HTML注释而忽略它。&nbsp;<br>　　&nbsp;<br>　　3，expireDate&nbsp;=&nbsp;new&nbsp;Date&nbsp;<br>　　&nbsp;<br>　　获取当前日期，并存入变量expireDate中。&nbsp;<br>　　&nbsp;<br>　　4，expireDate.setMonth(expireDate.getMonth()+6)&nbsp;<br>　　&nbsp;<br>　　获取当前月份值，将其加6后设置为expireDate的月份总值部分。这意味着本cookie的有效期为6个月。&nbsp;<br>　　&nbsp;<br>　　5，if&nbsp;(documents&nbsp;.cookie&nbsp;!=&nbsp;&quot;&quot;)&nbsp;<br>　　&nbsp;<br>　　如果document的值不为空，相当于检查用户硬盘上是否已经有了cookie。&nbsp;<br>　　&nbsp;<br>　　6，userName&nbsp;=&nbsp;documents&nbsp;.cookie.split(&quot;=&quot;)[1]&nbsp;<br>　　&nbsp;<br>　　此处用到了split(&quot;=&quot;)函数，它的功能是把cookie记录分割为数组，cookie的名为cookie[0],值为cookie[1],以此累推。所以此处documents&nbsp;.cookie.split(&quot;=&quot;)[1]返回的值是此cookie的值。在此句中将值赋给了变量username。&nbsp;<br>　　&nbsp;<br>　　7，function&nbsp;setCookie()&nbsp;<br>　　&nbsp;<br>　　设置名为setCookie的函数。&nbsp;<br>　　&nbsp;<br>　　8，documents&nbsp;.cookie&nbsp;=&nbsp;&quot;userName=&quot;+userName+&quot;;expires=&quot;&nbsp;+&nbsp;expireDate.toGMTString()&nbsp;<br>　　&nbsp;<br>　　此句是将设置好的cookie写入用户硬盘。expireDate.toGMTString()把expireDate中的值转换为文本字符串，这样才能写入cookie中。&nbsp;<br>　　&nbsp;<br>　　9，onLoad=&quot;document.myform.nameField.value&nbsp;=&nbsp;userName&quot;&nbsp;<br>　　&nbsp;<br>　　当页面载入时，把username的值写入文本框(如果有的话)。&nbsp;<br>　　&nbsp;<br>　　10，onBlur=&quot;setCookie()&quot;&nbsp;<br>　　&nbsp;<br>　　当用户离开文本框时，onBlur调用函数setCookie。&nbsp;<br>　　&nbsp;<br>　　结合上面的注释，读那段代码相信不成问题吧!既然我们可以建立cookie，那么读取也不是什么难事，请接着往下看!<br><br>　　二、读取和显示cookie&nbsp;<br>　　&nbsp;<br>　　一般来说，cookie的作者并不希望cookie被显示出来，这是当然的!天知道里面写了些什么!？然而这也是我们想要读出它的原因!~~~:D&nbsp;<br>　　&nbsp;<br>　　&lt;HTML&gt;&nbsp;<br>　　&lt;HEAD&gt;&nbsp;<br>　　&lt;TITLE&gt;Cookie&nbsp;Check&lt;/TITLE&gt;&nbsp;<br>　　&lt;/HEAD&gt;&nbsp;<br>　　&lt;BODY&nbsp;BGCOLOR=&quot;WHITE&quot;&gt;&nbsp;<br>　　&lt;H2&gt;&nbsp;<br>　　&lt;SCRIPT&nbsp;LANGUAGE=&quot;java&nbsp;script&quot;&nbsp;TYPE=&quot;TEXT/java&nbsp;script&quot;&gt;&nbsp;<br>　　&lt;!--&nbsp;Hide&nbsp;script&nbsp;from&nbsp;older&nbsp;browsers&nbsp;<br>　　&nbsp;<br>　　if&nbsp;(documents&nbsp;.cookie&nbsp;==&nbsp;&quot;&quot;)&nbsp;{&nbsp;<br>　　document.write(&quot;There&nbsp;are&nbsp;no&nbsp;cookies&nbsp;here&quot;)&nbsp;<br>　　}&nbsp;<br>　　else&nbsp;{&nbsp;<br>　　thisCookie&nbsp;=&nbsp;documents&nbsp;.cookie.split(&quot;;&nbsp;&quot;)&nbsp;<br>　　&nbsp;<br>　　for&nbsp;(i=0;&nbsp;i&lt;thisCookie.length;&nbsp;i++)&nbsp;{&nbsp;<br>　　document.write(&quot;Cookie&nbsp;name&nbsp;is&nbsp;’&quot;+thisCookie.split(&quot;=&quot;)[0])&nbsp;<br>　　document.write(&quot;’,&nbsp;and&nbsp;the&nbsp;value&nbsp;is&nbsp;’&quot;+thisCookie.split(&quot;=&quot;)[1]+&quot;’&lt;BR&gt;&quot;)&nbsp;<br>　　}&nbsp;<br>　　}&nbsp;<br>　　&nbsp;<br>　　//&nbsp;End&nbsp;hiding&nbsp;script&nbsp;--&gt;&nbsp;<br>　　&lt;/SCRIPT&gt;&nbsp;<br>　　&lt;/H2&gt;&nbsp;<br>　　&lt;/BODY&gt;&nbsp;<br>　　&lt;/HTML&gt;&nbsp;<br>　　&nbsp;<br>　　以上的便是一段读取cookie的名字和值的脚本。上文中解释过的语句在此不多赘述，且看有什么新的语法：&nbsp;<br>　　&nbsp;<br>　　1，thisCookie&nbsp;=&nbsp;documents&nbsp;.cookie.split(&quot;;&nbsp;&quot;)[注意：并非前文中出现过的split(&quot;=&quot;)。&nbsp;<br>　　&nbsp;<br>　　split(&quot;;&nbsp;&quot;)可以产生数组的结果，本句中，由documents&nbsp;.cookie.split(&quot;;&nbsp;&quot;)来获取cookie的值，并将这个数组赋值缎带变量：thisCookie。&nbsp;<br>　　&nbsp;<br>　　2，for&nbsp;(i=0;&nbsp;i&lt;thisCookie.length;&nbsp;i++)&nbsp;<br>　　&nbsp;<br>　　设置计算器变量i的值为0，如果其值小于thisCookie.length(thisCookie中值的个数)，将i的值加1。&nbsp;<br>　　&nbsp;<br>　　3，document.write(&quot;Cookie&nbsp;name&nbsp;is&nbsp;’&quot;+thisCookie.split(&quot;=&quot;)[0])&nbsp;<br>　　&nbsp;<br>　　此句中thisCookie.split(&quot;=&quot;)[0]较难理解，上面的脚本中，thiscookie已经被赋值为一个数组的值，那么thisCookie是指数组中第i个值，也就是第i个cookie，而由上文可知split(&quot;=&quot;)[0]是指cookie的名字。<br><br>　　这样thisCookie.split(&quot;=&quot;)[0]便是第i的cookie中cookie的名字!&nbsp;<br>　　&nbsp;<br>　　4,document.write(&quot;’,&nbsp;and&nbsp;the&nbsp;value&nbsp;is&nbsp;’&quot;+thisCookie.split(&quot;=&quot;)[1]&nbsp;<br>　　&nbsp;<br>　　跟3极为相似，即是第i个cookie中&nbsp;cookie的值。&nbsp;<br>　　&nbsp;<br>　　到此，我们已经熟悉了如何建立cookie以及它的读取。这些也正是cookie欺骗也需要的主要技术!<br><br>　　三、cookie欺骗的实现&nbsp;<br>　　&nbsp;<br>　　要做到cookie欺骗，最重要的是理解目标cookie中的储值情况，并设法改变它。由上面的学习我们知道，基于cookie的格式所限，一般来说，只有在Cookie.split(&quot;=&quot;)[0]和Cookie.split(&quot;=&quot;)[1]中的值对我们才是有用的。也就是说只需改变这两处或是处的值即可达到我们的目的。<br><br>　　而在实际操作中，还得先解决另一个问题。由于受浏览器的内部cookie机制所限，每个cookie只能被它的原服务器所访问!可我们总不能跑到人家服务器上操作吧!这里就需要一个小技巧了。<br><br>　　在上面我们提到过cookie的格式，最后两项中分别是它的url路径和域名。不难想到，服务器对cookie的识别靠的就是这个!<br><br>　　而在平时，我们要浏览一个网站时，输入的url便是它的域名，需要经过域名管理系统dns将其转化为IP地址后进行连接的。这其中就有一个空当。如果能在dns上做手脚，把目标域名的IP地址对应到其它站点上，我们便可以非法访问目标站点的cookie了!<br><br>　　做到这一点并不难，当然我不并不是要去操纵dns，而且那也是不可能的事情。在win9下的安装目录下，有一&nbsp;名为hosts.sam的文件，以文本方式打开后会看到这样的格式：<br><br>　　127.0.0.1&nbsp;lockhost&nbsp;#注释<br><br>　　利用它，我们便可以实现域名解析的本地化!而且其优先权高于网络中的dns!<br><br>　　具体使用时，只需将IP和域名依上面的格式添加，并另存为hosts即可!(注意：此文件无后赘名，并非hosts.sam&nbsp;文件本身!)&nbsp;<br>　　&nbsp;<br>　　到此，cookie欺骗所需的所以知识已经齐备。下面以一个“假”的例子，演示一下如何进入实战.(不便给出真实地址，以免引起犯罪!~~~:P)&nbsp;<br>　　假设目标站点是&nbsp;www.xxx.com&nbsp;<br>　　www.self.com是自己的站点。(可以用来存放欺骗目标所需的文件，用来读取和修改对方的cookie.)<br><br>　　首先ping出www.self.com的IP地址：<br><br>　　ping&nbsp;www.self.com&nbsp;<br>　　&nbsp;<br>　　Reply&nbsp;from&nbsp;12.34.56.78:&nbsp;bytes=32&nbsp;time=20ms&nbsp;TTL=244&nbsp;<br>　　&nbsp;<br>　　然后修改hosts.sam文件如下：&nbsp;<br>　　&nbsp;<br>　　12.34.56.78&nbsp;www.xxx.com&nbsp;<br>　　并保存为hosts。&nbsp;<br>　　&nbsp;<br>　　将用来读取cookie的页面传至www.self.com(脚本如二所示)。&nbsp;<br>　　此时连上www.xxx.com。由于我们已经对hosts动过手脚，这时来到的并不是www.xxx.com，而是www.self.com<br><br>　　www.xxx.com设在本地的cookie便可被读出!~~:D<br><br>　　然后根据具体情况修改一的脚本，用同样的方法，向此cookie中写入数据。修改完毕后，删掉hosts文件，再重新进入www.xxx.com，此时已经大功告成，可享受你的hack成果了!~~~:)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当然也可以网上下载一个COOKIES修改工具,修改COOKIES达到欺骗的目的,操作简单<br>　　&nbsp;<br>　　编后<br><br>　　cookie欺骗是一种发现较早，且较难使用的hack手法，除了java&nbsp;script&nbsp;可以控制以外，asp等也可以用来对其进进设置。所以在此声明，未必能对所有站点有较。但技术真实，无须置疑!&nbsp;<br>　　&nbsp;<br>　　补充：在win2000中hosts文件的建立与win98不同，需要c:\winnt\system32\drivers\etc文件夹中创建!windows&nbsp;xp&nbsp;c:\windows\system32\drivers\etc<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;以前飞天论坛的程序就存在cookies欺骗漏洞.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;往往新手程序员写的程序就存在COOKIES欺骗漏洞.&nbsp;cookies欺骗一般应用在会员系统中,如普通会员与VIP会员,大部分网站是通过一个COOKIES来识别,只要修改特定的COOKIES就可以实现.<br><br>]]></description></item><item><link>http://www.030904.com/blog/blogview.asp?logID=998</link><title><![CDATA[防止COOKIES被欺骗]]></title><author>glenluo</author><category>编程技术</category><pubDate>2010-3-12 18:45:59</pubDate><guid>http://www.030904.com/blog/blogview.asp?logID=998</guid><description><![CDATA[<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、加密保存COOKIES<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COOKIES保存时对值进行加密，读取的时候再进行解密。这就需要自已写一个加密解密程序。实现起来不太方便。<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、利用MD5加密校验COOKIES,md5函数网上很多。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将需要保存的COOKIES相加后加密，如：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;写COOKIES：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;login&quot;)(&quot;username&quot;)=username=username<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;login&quot;)(&quot;vip&quot;)=vip<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.cookies(&quot;login&quot;)(&quot;md5&quot;)=md5(username&amp;vip,32)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;判断COOKIES<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a=request.cookies(&quot;login&quot;)(&quot;username&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b=request.cookies(&quot;login&quot;)(&quot;vip&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c=request.cookies(&quot;login&quot;)(&quot;md5&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;c&lt;&gt;md5(a&amp;b,32)&nbsp;then<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.write&nbsp;&quot;cookies被修改&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;if<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&gt;]]></description></item>
</channel>
</rss>