Support the weight of the component-free ASP Advertisement display code _ Application Tips

Source: Internet
Author: User
The same site shows a lot of ads? Need different weights? Simple 20 lines of code.


Copy Code code as follows:

Dim Cc_fv_ad_468_80_code,cc_fv_ad_power,cc_fv_ad_i
' Advertising weights show the Moon Starlight Copyright http://www.5iya.com/blog Original
Cc_fv_ad_power = Array (1,3,2,4) ' Set each ad weight
Redim Cc_fv_ad_ubound (UBound (Cc_fv_ad_power))
Cc_fv_ad_ubound (0) = cc_fv_ad_power (0)
For cc_fv_ad_i = 1 to Ubound (cc_fv_ad_power)
Cc_fv_ad_ubound (cc_fv_ad_i) = Cc_fv_ad_ubound (cc_fv_ad_i-1) +cc_fv_ad_power (cc_fv_ad_i)
Next
Randomize
Dim Cc_fv_ad_j,cc_fv_ad_random,cc_fv_ad_number
Cc_fv_ad_number = 1
Cc_fv_ad_random = Int (Rnd*cc_fv_ad_ubound (UBound (cc_fv_ad_power))) +1
For Cc_fv_ad_j = 0 to Ubound (cc_fv_ad_power)
If cc_fv_ad_random <= cc_fv_ad_ubound (cc_fv_ad_j) Then
Cc_fv_ad_number = Cc_fv_ad_j
Exit for
End If
Next
' Ad code
Cc_fv_ad_468_80_code = Array ("<iframe width=" "468" "height=" "" "align=" "Center" "marginwidht=" "0" "Name=" " Union163com "" marginheight= "" 0 "" hspace= "" 0 "" vspace= "" 0 "" frameborder= "" 0 "" scrolling= "" No "" src= "" http://" news2.163.com/product/photo/tpl1.jsp?id=yibaoxiang&no=21688&productid=0422 "" ></iframe> "," < Script type= "Text/javascript" "src=" "Http://www.joyo.com/lianmeng/ad.asp?s=cg5iyacom&k=1" "></script > "," Http://www.5iya.com/blog "," <script language= "" JavaScript1.1 "" src= "" http://smarttrade.allyes.com/main/ Adfshow?user=1|8033|103810&db=smarttrade&border=0&local=yes&js=ie "" ></script> ")
Response.Write Cc_fv_ad_468_80_code (Cc_fv_ad_number)

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.