手机
当前位置:查字典教程网 >编程开发 >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获取到的系统时间有上午,下午的解决方法

Aspjpeg添加水印完整方法

一个防止被采集的方法

用asp实现无组件生成验证码的方法2种

ASP中80040e14错误的原因及解决方法

存储过程里的递归 实现方法

Session对象失效的客户端解决方法

通过Response.Flush()实现下载失败的解决方法

[asp]怎么添加验证码的解决方法

解决ASP(图像)上传漏洞的方法

精品推荐
分类导航