SoFunction
Updated on 2025-03-04

Summary of commonly used source code of ASP (Part 1)

ASP is the abbreviation of Active Server Page, meaning "dynamic server page". ASP is an application developed by Microsoft to replace CGI scripting programs. It can interact with databases and other programs and is a simple and convenient programming tool. The following is a summary of the code that ASP often uses.

1. Obtain system time:

<%=now()%> 

2. Obtain the IP for visiting:

<%=("remote_host")%> 

3. Obtain the system and browser version:

&lt;script&gt; 
("Version:"+++" browser.") 
&lt;/script&gt; 

4. Remove the IE hybrid bar:

&lt;body scroll="no"&gt; 
or

&lt;body style="overflow-y:hidden"&gt; 

5. Enter the website and pop up the ad:

&lt;script language="javascript"&gt; 
&lt;!-- 
&lt;!-- Please change the path of the file--&gt; 
('','','height=200,width=300,top=0,left=30'); 
// --&gt; 
&lt;/script&gt; 

6. Random number: 

<%randomize%> 
<%=(int(rnd()*n)+1)%> 

N is the variable number

7. Scroll up the code:

<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. Automatically close the web page:

&lt;script LANGUAGE="javascript"&gt; 
&lt;!-- 
setTimeout('();', 10000); // Closed after 60 seconds// --&gt; 
&lt;/script&gt; 
&lt;p align="center"&gt;This page10Automatically close in seconds,Please note that refresh the page&lt;/p&gt; 

9. Random background music:

<%randomize%> 
<bgsound src="mids/<%=(int(rnd()*60)+1)%>.mid" loop="-1"> 

You can modify the number and limit the number of calls. Here are 60.

10. Automatically refresh this page:

&lt;script&gt; 
&lt;!-- 
var limit="0:10" 
if (){ 
var parselimit=(":") 
parselimit=parselimit[0]*60+parselimit[1]*1 
} 
function beginrefresh(){ 
if (!) 
return 
if (parselimit==1) 
() 
else{ 
parselimit-=1 
curmin=(parselimit/60) 
cursec=parselimit%60 
if (curmin!=0) 
curtime=curmin+"point"+cursec+"Refresh this page in seconds!" 
else 
curtime=cursec+"Refresh this page in seconds!" 
=curtime 
setTimeout("beginrefresh()",1000) 
} 
} 
=beginrefresh 
file://--&gt; 
&lt;/script&gt; 

This is the first article about the commonly used source code of ASP, and the next article will recommend to you another 12 commonly used source codes that are essential for beginners.