随机数:
<%randomize%>DrrLinux联盟
<%=(int(rnd()*n)+1)%>
查询数据时得到的记录关键字用红色显示:
<% =replace(RS("字段X"),searchname,"<font color=#FF0000>" & searchname & "</font>") %>
通过asp的手段来检查来访者是否用了代理
<% if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" thenDrrLinux联盟
response.write "<font color=#FF0000>您通过了代理服务器,"& _DrrLinux联盟
"真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")DrrLinux联盟
end ifDrrLinux联盟
%>
判断上一页的来源
request.servervariables("HTTP_REFERER")DrrLinux联盟
javascript: document.referrer
清除缓存,重新加载页面
<%response.expires = 0 DrrLinux联盟
response.expiresabsolute = now() - 1DrrLinux联盟
response.addHeader "pragma","no-cache"DrrLinux联盟
response.addHeader "cache-control","private"DrrLinux联盟
Response.cachecontrol = "no-cache"DrrLinux联盟
%>
在下拉菜单中显示年和月
<select name="select">DrrLinux联盟
<%DrrLinux联盟
Dim M_Year DrrLinux联盟
Dim M_MonthDrrLinux联盟
Dim M_MonthJDrrLinux联盟
Dim M_TheMonthDrrLinux联盟
Dim M_YMDrrLinux联盟
For M_Year = 2000 To Year(Date) DrrLinux联盟
M_Month = 12 DrrLinux联盟
If M_Year = Year(Date) Then DrrLinux联盟
M_Month = Month(Date) DrrLinux联盟
End IfDrrLinux联盟
For M_MonthJ=1 To M_MonthDrrLinux联盟
If M_MonthJ < 10 ThenDrrLinux联盟
M_TheMonth = "0" & M_MonthJDrrLinux联盟
ElseDrrLinux联盟
M_TheMonth = M_MonthJDrrLinux联盟
End IfDrrLinux联盟
M_YM = M_Year& "-" & M_TheMonth %>DrrLinux联盟
<option value="<%= M_YM %>"><%= M_YM %></option>DrrLinux联盟
<%DrrLinux联盟
NextDrrLinux联盟
Next %>DrrLinux联盟
</select>
检索并删除数据库里的重复记录
conn.execute("delete from table where id not in (select distinct from table)")
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论