ASP常用的代码(不断更新)
2007-12-09 12:50:04 来源:WEB开发网核心提示:1.获得系统时间:<%=now()%>2.取得来访用的IP:<%=request.serverVariables("remote_host")%>3.获得系统,浏览器版本:<script>window.document.write("版本:"+
1.获得系统时间:
<%=now()%>
2.取得来访用的IP:
<%=request.serverVariables("remote_host")%>
3.获得系统,浏览器版本:
<script>
window.document.write("版本:"+navigator.appName+navigator.appVersion+" browser.")
</script>
4.去除IE混动条:
<body scroll="no">
<body style="overflow-y:hidden">
5.进入网站,跳出广告:
<script language="javascript">
<!--
<!-- 注意更改文件所在路径-->
window.open(''http://www.XXXXXX.com'','''',''height=200,width=300,top=0,left=30'');
// -->
</script>
6.随机数:
<%randomize%>
<%=(int(rnd()*n)+1)%>
N为可改变数
7.向上混动代码:
<marquee direction="up" scrolldelay="200" style="font-size: 9pt; color: #FF0000; line-height: 150%; font-style:italic; font-weight:bold" scrollamount="2" width="206" height="207" bgcolor="#FFFF00">hhhhhhhhhhhhhhhhhhh</marquee>
8.自动关闭网页:
<script LANGUAGE="javascript">
<!--
setTimeout(''window.close();'', 10000); //60秒后关闭
// -->
</script>
<p align="center">本页10秒后自动关闭,请注意刷新页面</p>
9.随机背景音乐:
<%randomize%>
<bgsound src="http://web.rdxx.com/Files/Pic/Img/NETTemp/0682506414117558.GIF") then
response.write "<tr><td>" & f1.name & "</td><td>" & f1.Datecreated & "</td><td>" & f1.Size & "</td><td>"
if gfxSpex(f1.Path, w, h, c, strType) = true then
response.write w & " x " & h & " " & c & " colors"
else
response.write " "
end if
response.write "</td></tr>"
end if
Next
response.write "</table>"
set objFC = nothing
set objF = nothing
set objFSO = nothing
%>
23.点击返回上页代码:
<form>
<p><input TYPE="button" value="返回上一步" ></p>
</form>
24.点击刷新代码㈠:
<form>
<p><input TYPE="button" value="刷新按钮一" ></p>
</form>
<script language="javascript"><!--
function ReloadButton(){location.href="allbutton.htm";}
24.点击刷新代码㈡:
<form>
<p><input TYPE="button" value="刷新按钮二" > </p>
</form>
<form>
<p><input TYPE="button" value="打开一个网站" ></p>
</form>
<script language="javascript"><!--
function HomeButton(){location.href="http://nettrain.126.com";;;;}
// --></script>
25.弹出警告框代码:
<form>
<p><input TYPE="button" value="弹出警告框" ></p>
</form>
<%=now()%>
2.取得来访用的IP:
<%=request.serverVariables("remote_host")%>
3.获得系统,浏览器版本:
<script>
window.document.write("版本:"+navigator.appName+navigator.appVersion+" browser.")
</script>
4.去除IE混动条:
<body scroll="no">
<body style="overflow-y:hidden">
5.进入网站,跳出广告:
<script language="javascript">
<!--
<!-- 注意更改文件所在路径-->
window.open(''http://www.XXXXXX.com'','''',''height=200,width=300,top=0,left=30'');
// -->
</script>
6.随机数:
<%randomize%>
<%=(int(rnd()*n)+1)%>
N为可改变数
7.向上混动代码:
<marquee direction="up" scrolldelay="200" style="font-size: 9pt; color: #FF0000; line-height: 150%; font-style:italic; font-weight:bold" scrollamount="2" width="206" height="207" bgcolor="#FFFF00">hhhhhhhhhhhhhhhhhhh</marquee>
8.自动关闭网页:
<script LANGUAGE="javascript">
<!--
setTimeout(''window.close();'', 10000); //60秒后关闭
// -->
</script>
<p align="center">本页10秒后自动关闭,请注意刷新页面</p>
9.随机背景音乐:
<%randomize%>
<bgsound src="http://web.rdxx.com/Files/Pic/Img/NETTemp/0682506414117558.GIF") then
response.write "<tr><td>" & f1.name & "</td><td>" & f1.Datecreated & "</td><td>" & f1.Size & "</td><td>"
if gfxSpex(f1.Path, w, h, c, strType) = true then
response.write w & " x " & h & " " & c & " colors"
else
response.write " "
end if
response.write "</td></tr>"
end if
Next
response.write "</table>"
set objFC = nothing
set objF = nothing
set objFSO = nothing
%>
23.点击返回上页代码:
<form>
<p><input TYPE="button" value="返回上一步" ></p>
</form>
24.点击刷新代码㈠:
<form>
<p><input TYPE="button" value="刷新按钮一" ></p>
</form>
<script language="javascript"><!--
function ReloadButton(){location.href="allbutton.htm";}
24.点击刷新代码㈡:
<form>
<p><input TYPE="button" value="刷新按钮二" > </p>
</form>
<form>
<p><input TYPE="button" value="打开一个网站" ></p>
</form>
<script language="javascript"><!--
function HomeButton(){location.href="http://nettrain.126.com";;;;}
// --></script>
25.弹出警告框代码:
<form>
<p><input TYPE="button" value="弹出警告框" ></p>
</form>
- ››asp.net页面弄成伪静态页面
- ››常用的Windows 7操作系统实用技巧
- ››Asp.net 中将汉字转换成拼音的方法
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
更多精彩
赞助商链接