当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一些Asp技巧和实用解决方法

ASP
asp #include命令
推荐下天枫常用ASP函数封装,推荐大家使用
asp最简单最实用的计数器
用asp实现的iframe批量替换工具
ASPWebPack 代码 提供下载
asp分页生成html的程序脚本代码
比较不错的asp单表单字段多条件查询
asp下用replace非正则实现代码运行功能的代码
UpdatePanel触发javascript脚本的方法附代码
生成EAN13标准的条形码的ASP代码实例
asp空间奸商查询系统
ASPWebPack(整站文件备份系统) v1.0.2 黑客也用
ASP+FSO可视化目录编历(可增、删、改)下载
提高ASP效率的五大技巧
ASP生成随机字符串(数字+大小写字母)的代码
ASP下存储过程编写入门全接触
利用 cache 做对比静态页的网页技术
ASP生成静态文件编码为UTF-8格式的HTML文件
ASP下的两个防止SQL注入式攻击的Function
asp下的风讯用的SQL通用防注入模块提供了

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 30 ::
收藏到网摘: n/a

一些Asp技巧和实用解决方法
随机数:
<%randomize%>
<%=(int(rnd()*n)+1)%>
查询数据时得到的记录关键字用红色显示:
<% =replace(RS("字段X"),searchname,"<font color=#FF0000>" & searchname & "</font>") %>
通过asp的手段来检查来访者是否用了代理
<% if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" then
response.write "<font color=#FF0000>您通过了代理服务器,"& _
"真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
%>
判断上一页的来源
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"
%>
在下拉菜单中显示年和月
<select name="select">
<%
Dim M_Year
Dim M_Month
Dim M_MonthJ
Dim M_TheMonth
Dim M_YM
For M_Year = 2000 To Year(Date)
M_Month = 12
If M_Year = Year(Date) Then
M_Month = Month(Date)
End If
For M_MonthJ=1 To M_Month
If M_MonthJ < 10 Then
M_TheMonth = "0" & M_MonthJ
Else
M_TheMonth = M_MonthJ
End If
M_YM = M_Year& "-" & M_TheMonth %>
<option value="<%= M_YM %>"><%= M_YM %></option>
<%
Next
Next %>
</select>
检索并删除数据库里的重复记录
conn.execute("delete from table where id not in (select distinct from table)")