支持权重的无组件ASP广告显示代码
网络编程 2021-07-05 10:58www.168986.cn编程入门
网站同一显示很多广告?需要不同权重?简单的20行代码。
Dim _fv_ad_468_80_code,_fv_ad_power,_fv_ad_i
'广告权重显示 明月星光 Copyright http://.5iya./blog 原创
_fv_ad_power = Array(1,3,2,4) '设置每个广告权重
Redim _fv_ad_ubound(Ubound(_fv_ad_power))
_fv_ad_ubound(0) = _fv_ad_power(0)
For _fv_ad_i = 1 To Ubound(_fv_ad_power)
_fv_ad_ubound(_fv_ad_i) = _fv_ad_ubound(_fv_ad_i-1)+_fv_ad_power(_fv_ad_i)
Next
Randomize
Dim _fv_ad_j,_fv_ad_random,_fv_ad_number
_fv_ad_number = 1
_fv_ad_random = Int(Rnd_fv_ad_ubound(Ubound(_fv_ad_power)))+1
For _fv_ad_j = 0 To Ubound(_fv_ad_power)
If _fv_ad_random <= _fv_ad_ubound(_fv_ad_j) Then
_fv_ad_number = _fv_ad_j
Exit For
End If
Next
'广告代码
_fv_ad_468_80_code = Array("<iframe width=""468"" height=""60"" align=""center"" marginwidht=""0"" name=""union163"" marginheight=""0"" hspace=""0"" vspace=""0"" frameborder=""0"" scrolling=""no"" src=""http://news2.163./product/photo/tpl1.jsp?ID=yibaoxiang&NO=21688&productid=0422""></iframe>","<script type=""text/javascript"" src=""http://.joyo./lianmeng/ad.asp?s=cg5iya&k=1""></script>","http://.5iya./blog","<script language=""JavaScript1.1"" src=""http://smarttrade.allyes./main/adfshow?user=1|8033|103810&db=smarttrade&border=0&local=yes&js=ie""></script>")
Response.Write _fv_ad_468_80_code(_fv_ad_number)
代码如下:
Dim _fv_ad_468_80_code,_fv_ad_power,_fv_ad_i
'广告权重显示 明月星光 Copyright http://.5iya./blog 原创
_fv_ad_power = Array(1,3,2,4) '设置每个广告权重
Redim _fv_ad_ubound(Ubound(_fv_ad_power))
_fv_ad_ubound(0) = _fv_ad_power(0)
For _fv_ad_i = 1 To Ubound(_fv_ad_power)
_fv_ad_ubound(_fv_ad_i) = _fv_ad_ubound(_fv_ad_i-1)+_fv_ad_power(_fv_ad_i)
Next
Randomize
Dim _fv_ad_j,_fv_ad_random,_fv_ad_number
_fv_ad_number = 1
_fv_ad_random = Int(Rnd_fv_ad_ubound(Ubound(_fv_ad_power)))+1
For _fv_ad_j = 0 To Ubound(_fv_ad_power)
If _fv_ad_random <= _fv_ad_ubound(_fv_ad_j) Then
_fv_ad_number = _fv_ad_j
Exit For
End If
Next
'广告代码
_fv_ad_468_80_code = Array("<iframe width=""468"" height=""60"" align=""center"" marginwidht=""0"" name=""union163"" marginheight=""0"" hspace=""0"" vspace=""0"" frameborder=""0"" scrolling=""no"" src=""http://news2.163./product/photo/tpl1.jsp?ID=yibaoxiang&NO=21688&productid=0422""></iframe>","<script type=""text/javascript"" src=""http://.joyo./lianmeng/ad.asp?s=cg5iya&k=1""></script>","http://.5iya./blog","<script language=""JavaScript1.1"" src=""http://smarttrade.allyes./main/adfshow?user=1|8033|103810&db=smarttrade&border=0&local=yes&js=ie""></script>")
Response.Write _fv_ad_468_80_code(_fv_ad_number)
上一篇:ASP下实现自动采集程序及入库的代码
下一篇:关于ASP代码的加密的几个方法
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程