ASP常用特效代码大全

1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键

no
可用于Table

2. 取消选取、防止复制

3. onpaste="return false" 不准粘贴

4. oncopy="return false;" oncut="return false;" 防止复制

5. IE地址栏前换成自己的图标

6. 可以在收藏夹中显示出你的图标

7. 关闭输入法

8. 永远都会带着框架


9. 防止被人frame


10. 网页将不能被另存为

11. onclick="window.location = 'view-source:'+ 'https://www.360docs.net/doc/2f19000416.html,/'">

12. 怎样通过asp的手段来检查来访者是否用了代理
<% if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" then
response.write "您通过了代理服务器,"& _
"真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
%>

13. 取得控件的绝对位置

//javascript


//VBScript


14. 光标是停在文本框文字的最后


15. 判断上一页的来源
asp:
request.servervariables("HTTP_REFERER")

javascript:
document.referrer

16. 最小化、最大化、关闭窗口










本例适用于IE

17.
<%
'定义数据库连接的一些

常量
Const adOpenForwardOnly = 0 '游标只向前浏览记录,不支持分页、Recordset、BookMark
Const adOpenKeyset = 1 '键集游标,其他用户对记录说做的修改将反映到记录集中,但其他用户增加或删除记录不会反映到记录集中。支持分页、Recordset、BookMark
Const adOpenDynamic = 2 '动态游标功能最强,但耗资源也最多。用户对记录说做的修改,增加或删除记录都将反映到记录集中。支持全功能浏览(ACCESS不支持)。
Const adOpenStatic = 3 '静态游标,只是数据的一个快照,用户对记录说做的修改,增加或删除记录都不会反映到记录集中。支持向前或向后移动

Const adLockReadOnly = 1 '锁定类型,默认的,只读,不能作任何修改
Const adLockPessimistic = 2 '当编辑时立即锁定记录,最安全的方式
Const adLockOptimistic = 3 '只有在调用Update方法时才锁定记录集,而在此前的其他操作仍可对当前记录进行更改、插入和删除等
Const adLockBatchOptimistic = 4 '当编辑时记录不会被锁定,而更改、插入和删除是在批处理方式下完成的

Const adCmdText = &H0001
Const adCmdTable = &H0002
%>

18. 网页不会被缓存
HTM网页



或者
ASP网页
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
PHP网页
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

19. 检查一段字符串是否全由数字组成


20. 获得一个窗口的大小
document.body.clientWidth,document.body.clientHeight

21. 怎么判断是否是字符
if (/[^\x00-\xff]/g.test(s)) alert("含有汉字");
else alert("全是字符");

22.TEXTAREA自适应文字行数的多少


23. 日期减去天数等于第二个日期


24. 选择了哪一个Radio

Style
Barcode

lue="check" onclick="checkme()">


25.获得本页url的request.servervariables("")集合
Response.Write "

"
for each ob in Request.ServerVariables
Response.Write ""
next
Response.Write "
Variablesvalue
"&ob&""&Request.ServerVariables(ob)&"
"

26.
本机ip<%=request.servervariables("remote_addr")%>
服务器名<%=Request.ServerVariables("SERVER_NAME")%>
服务器IP<%=Request.ServerVariables("LOCAL_ADDR")%>
服务器端口<%=Request.ServerVariables("SERVER_PORT")%>
服务器时间<%=now%>
IIS版本<%=Request.ServerVariables"SERVER_SOFTWARE")%>
脚本超时时间<%=Server.ScriptTimeout%>
本文件路径<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%>
服务器CPU数量<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>
服务器解译引擎<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>
服务器操作系统<%=Request.ServerVariables("OS")%>

27.ENTER键可以让光标移到下一个输入框


28. 检测某个网站的链接速度:
把如下代码加入区域中:


29. 各种样式的光标
auto :标准光标
default :标准箭头
hand :手形光标
wait :等待光标
text :I形光标
vertical-text :水平I形光标
no-drop :不可拖动光标
not-allowed :无效光标
help :?帮助光标
all-scroll :三角方向标
move :移动标
crosshair :十字标
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize


ASP源代码之页面延迟的两个简单方法
一。
<% Response.Buffer = True %>
<%
'' Setup the variables necessary to accomplish the task
Dim Tim
erStart, TimerEnd, TimerNow, TimerWait
'' How many seconds do you want them to wait...
TimerWait = 5
'' Setup and start the timers
TimerNow = Timer
TimerStart = T

imerNow
TimerEnd = TimerStart + TimerWait
'' Keep it in a loop for the desired length of time
Do While (TimerNow < TimerEnd)
'' Determine the current and elapsed time
TimerNow = Timer
If (TimerNow < TimerStart) Then
TimerNow = TimerNow + 86400
End If
Loop
'' Okay times up, lets git em outa here
Response.Redirect "nextpage.html" %>

二。

<%
Sub TimeDelaySeconds(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>

'' To change delay adjust here
<% TimeDelaySeconds(2) %>




ASP实现K线图
Mschart组件使用方法 
[WITCODE]
1。Chart Activex控件
In the HTML page, insert an tag for the License Manager object before any other tags. The License Manager is an ActiveX control that is installed with Internet Explorer.
NOTE: This CLASSID, "5220cb21-c88d-11cf-b347-00aa00a28331", is for the License Manager and not for your ActiveX controls. You must use the same CLASSID every time you refer to the LPK file. In addition, you should keep the Name property of the tag as "LPKPath", and set the Value property for the tag of the License Manager object to the LPK file name and path. This path may be a relative path but must not refer to a UNC share or a URL on another domain.
Because you can only have one LPK file for each HTML page, make sure that you include all of the licensed ActiveX Controls for the page when you generate your LPK file. For example:
id="Microsoft_Licensed_Class_Manager_1_0">


Insert the tag for your licensed control afterward. For example, an HTML page that displays the Microsoft Masked Edit control looks like this.
Here I downloaded the file mschart.cab from Microsoft''s website. It has been digitally signed.
id=mschart1 style="HEIGHT: 326px; WIDTH: 651px" CODEBASE="mschart.cab">
You can look this acticle if you need help.
https://www.360docs.net/doc/2f19000416.html,/support/kb/articles/Q159/9/23.ASP
2。Mschart组件的一些常用属性介绍
a。charttype:图形的类型
charttype=0>三维直方图
charttype=1>二维直方图
charttype=2>三维折线图
charttype=3>二维折线图
charttype=4>三维面积图
charttype=5>二维面积图
charttype=14>饼图
b。showlegend:是否显示解说
c。titletext:标题
d。Columncount: The number of data columns
e。Rowcount:The number of data rows
f。Footnotetext:The footnote text.
g。Plot: Returns a reference to a Plot object that describes the area upon which a chart is displayed.
h。row: A row number in the current column. Rows are numbered from top to bottom beginning with 1. column: The current data column.
i。Rowlabel: The text for a row label. The label you specify sets

the label for the data points identified by the Row property. This label appears along the category axis for most chart types and is used as the label for each individual pie in a pie chart. Label text may not be displayed if it is too long to fit on a chart.columnlabel: . Label text associated with a column in the data grid.
j。Data: The data point value. If the current data point already contains a value, it is replaced by the new value. The chart is redrawn to reflect the new value for the current data point.
k。ChartData: A two-dimensional array that holds the data used to draw the chart. If the first series of a multi-dimensional array contains strings, those strings will become the labels of the chart.ChartData is the default property for the MSChart control.
It is so many properities about Mschart Activex.I only introduce so much.Now,I will provide your two example to you!I wish it can help you understand it.
Example 1t come from:
https://www.360docs.net/doc/2f19000416.html,/webtech/MSChartExample.shtm
id="Microsoft_Licensed_Class_Manager_1_0">


id=mschart1 style="HEIGHT: 326px; WIDTH: 651px" CODEBASE="mschart.cab">

Example 2:We almost can see it everywhere.




数据显示<br></p><!--/p5--><!--p6--><p>图


id="Microsoft_Licensed_Class_Manager_1_0">


id=mschart1 style="HEIGHT: 326px; WIDTH: 651px" CODEBASE="mschart.cab">


显示方式

chtitle 标题
rcount 列数
ccount 行数
rc_type 排列方式(1 为行方式;2 为列方式)
rc_data 数据
rname 列名数组
cname 行名数组

















[/WITCODE]




常用ASP特效代码-网页制作代码小技巧-12008-10-18 12:181.设置滚动条颜色
scrollbar-3d-light-color 立体滚动条亮边的颜色(设置滚动条的颜色)
scrollbar-arrow-color 上下按钮上三角箭头的颜色
scrollbar-base-color 滚动条的基本颜色
scrollbar-dark-shadow-color 立体滚动条强阴影的颜色
scrollbar-face-color 立体滚动条凸出部分的颜色
scrollbar-highlight-color 滚动条空白部分的颜色
scrollbar-shadow-color 立体滚动条阴影的颜色


2.获得系统时间:
<%=now()%>

3.取得来访用的IP:
<%=request.serverVariables("remote_host")%>

4.获得系统,浏览器版本:


5.去除IE混动条:



6.进入网站,跳出广告:


7.随机数:
<%randomize%>
<%=(int(rnd()*n)+1)%>
N为可改变



8.向上混动代码:
height="207" bgcolor="#FFFF00">hhhhhhhhhhhhhhhhhhh
9.自动关闭网页:

本页10秒后自动关闭,请注意刷新页面



10.随机背景音乐:
<%randomize%>
 

可以修改数字,限制调用个数,我这里是60个.



0.设置滚动条颜色
scrollbar-3d-light-color立体滚动条亮边的颜色(设置滚动条的颜色)
scrollbar-arrow-color上下按钮上三角箭头的颜色
scrollbar-base-color滚动条的基本颜色
scrollbar-dark-shadow-color立体滚动条强阴影的颜色
scrollbar-face-color立体滚动条凸出部分的颜色
scrollbar-highlight-color滚动条空白部分的颜色
scrollbar-shadow-color立体滚动条阴影的颜色


1.获得系统时间:
<%=now()%>
2.取得来访用的IP:
<%=request.serverVariables("remote_host")%>
3.获得系统,浏览器版本:

4.去除IE混动条:


5.进入网站,跳出广告: