手机
当前位置:查字典教程网 >编程开发 >ASP教程 >一些Asp技巧和实用解决方法
一些Asp技巧和实用解决方法
摘要:一些Asp技巧和实用解决方法随机数:查询数据时得到的记录关键字用红色显示:通过asp的手段来检查来访者是否用了代理判断上一页的来源reque...

一些Asp技巧和实用解决方法

随机数:

<%randomize%>

<%=(int(rnd()*n)+1)%>

查询数据时得到的记录关键字用红色显示:

<%=replace(RS("字段X"),searchname,"<fontcolor=#FF0000>"&searchname&"</font>")%>

通过asp的手段来检查来访者是否用了代理

<%ifRequest.ServerVariables("HTTP_X_FORWARDED_FOR")<>""then

response.write"<fontcolor=#FF0000>您通过了代理服务器,"&_

"真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")

endif

%>

判断上一页的来源

request.servervariables("HTTP_REFERER")

javascript:document.referrer

清除缓存,重新加载页面

<%response.expires=0

response.expiresabsolute=now()-1

response.addHeader"pragma","no-cache"

response.addHeader"cache-control","private"

Response.cachecontrol="no-cache"

%>

在下拉菜单中显示年和月

<selectname="select">

<%

DimM_Year

DimM_Month

DimM_MonthJ

DimM_TheMonth

DimM_YM

ForM_Year=2000ToYear(Date)

M_Month=12

IfM_Year=Year(Date)Then

M_Month=Month(Date)

EndIf

ForM_MonthJ=1ToM_Month

IfM_MonthJ<10Then

M_TheMonth="0"&M_MonthJ

Else

M_TheMonth=M_MonthJ

EndIf

M_YM=M_Year&"-"&M_TheMonth%>

<optionvalue="<%=M_YM%>"><%=M_YM%></option>

<%

Next

Next%>

</select>

检索并删除数据库里的重复记录

conn.execute("deletefromtablewhereidnotin(selectdistinctfromtable)")

【一些Asp技巧和实用解决方法】相关文章:

无组件上传图片之文件采用方案

一个实用asp分页函数

NAV导致IIS调用FSO失败的解决方法

Asp Response.CharSet 怎么解决?

ASP程序密码验证漏洞解决方案

ASP中七种实现分页显示的方法

Aspjpeg添加水印完整方法

一个防止被采集的方法

aspjpeg组件使用方法

ASP代码给网页添加验证码的实现方法

精品推荐
分类导航