文章詳情頁
ASP常用源代碼的總結(jié)(上)
瀏覽:346日期:2022-06-05 13:09:14
ASP是Active Server Page的縮寫,意為“動態(tài)服務(wù)器頁面”。ASP是微軟公司開發(fā)的代替CGI腳本程序的一種應(yīng)用,它可以與數(shù)據(jù)庫和其它程序進行交互,是一種簡單、方便的編程工具。下面介紹的是ASP經(jīng)常用到的代碼總結(jié)。
1.獲得系統(tǒng)時間:
<%=now()%>
2.取得來訪用的IP:
<%=request.serverVariables("remote_host")%>
3.獲得系統(tǒng),瀏覽器版本:
<script> window.document.write("版本:"+navigator.appName+navigator.appVersion+" browser.") </script>
4.去除IE混動條:
<body scroll="no"> 或 <body>
5.進入網(wǎng)站,跳出廣告:
<script language="javascript"> <!-- <!-- 注意更改文件所在路徑--> window.open("http://www.XXXXXX.com","","height=200,width=300,top=0,left=30"); // --> </script>
6.隨機數(shù):
<%randomize%> <%=(int(rnd()*n)+1)%>
N為可改變數(shù)
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.自動關(guān)閉網(wǎng)頁:
<script LANGUAGE="javascript"> <!-- setTimeout("window.close();", 10000); //60秒后關(guān)閉 // --> </script> <p align="center">本頁10秒后自動關(guān)閉,請注意刷新頁面</p>
9.隨機背景音樂:
<%randomize%> <bgsound src="mids/<%=(int(rnd()*60)+1)%>.mid" loop="-1">
可以修改數(shù)字,限制調(diào)用個數(shù),我這里是60個.
10.自動刷新本頁面:
<script> <!-- var limit="0:10" if (document.images){ var parselimit=limit.split(":") parselimit=parselimit[0]*60+parselimit[1]*1 } function beginrefresh(){ if (!document.images) return if (parselimit==1) window.location.reload() else{ parselimit-=1 curmin=Math.floor(parselimit/60) cursec=parselimit%60 if (curmin!=0) curtime=curmin+"分"+cursec+"秒后重刷本頁!" else curtime=cursec+"秒后重刷本頁!" window.status=curtime setTimeout("beginrefresh()",1000) } } window.onload=beginrefresh file://--> </script>
這是關(guān)于ASP常用源代碼的上篇,下一篇文章再為大家推薦新手必備的另12個常用源代碼。
標簽:
ASP
相關(guān)文章:
1. Java8內(nèi)存模型PermGen Metaspace實例解析2. asp批量添加修改刪除操作示例代碼3. PHP VS ASP4. flappy bird游戲源代碼揭秘和下載 —— 可運行于android、ios和html5多平臺5. 手把手教你使用Java來編寫ASP組件(1)6. ASP程序中常用的腳本語言7. ASP.NET MVC實現(xiàn)區(qū)域或城市選擇8. java實現(xiàn)2048游戲源代碼9. asp.net core應(yīng)用docke部署到centos7的全過程10. ASP.NET MVC前臺動態(tài)添加文本框并在后臺使用FormCollection接收值
排行榜
