ASP common source code Summary (top) _ Application Skills

Source: Internet
Author: User

ASP is an abbreviation for Active Server page, meaning "dynamic servers pages." ASP is an application developed by Microsoft to replace the CGI script program, it can interact with database and other programs, it is a simple and convenient programming tool. The following is a summary of the code that is often used by ASPs.

1. Access to System time:

<%=now ()%> 

2. Access to the IP:


 

3. Access to the system, browser version:

<script> 
window.document.write ("version:" +navigator.appname+navigator.appversion+ "browser.") 

4. Remove IE Mixing strips:

<body scroll= "No" > 
or

<body style= "Overflow-y:hidden" > 

5. Go to the website and jump out of the advertisement:

<script language= "JavaScript" > 
<!-- 
<!--Notice to change the path where the file is located--> 
window.open (' http://www. Xxxxxx.com ', ', ' height=200,width=300,top=0,left=30 '); 
--> 
</script> 

6. Random Number: 

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

N is a number that can be changed

7. Scroll up the code:

<marquee direction= "Up" scrolldelay= " 
style=" font-size:9pt; color: #FF0000; line-height:150% : italic; Font-weight:bold " 
scrollamount=" 2 "width=" 206 "height=" 207 "bgcolor=" #FFFF00 ">hhhhhhhhhhhhhhhhhhh</ Marquee> 

8. Automatically close the Web page:

<script language= "JavaScript" > 
<!-- 
settimeout (' Window.close (); ', 10000);//60 seconds to close 
//--> 
</script> 
<p align= "center" > This page automatically closes after 10 seconds, please note refresh page </p> 

9. Random background music:

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

Can modify the number, limit the number of calls, I am here 60.

10. Automatically refresh this page:

<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+" seconds after the brush this page! " 
else 
curtime=cursec+" seconds to brush this page! " 
window.status=curtime 
settimeout (" Beginrefresh () ", 1000) 
} 
} 
window.onload= Beginrefresh 
file://--> 
</script> 

This is the ASP commonly used source code of the previous article, the next article for everyone to recommend the necessary additional 12 common source code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.