欢迎光临
我们一直在努力

产生随机滚动信息_asp技巧

建站超值云服务器,限时71元/月

产生随机滚动信息 (Charles Carroll/蜘蛛精 译)
Random Advice / Rotating Information by Charles Carroll
本页演示了通过产生随机数的方式实现出现随机滚动信息的方法

RND函数

INT函数

SELECT CASE

代码randomadvice.asp演示了当每次页面被刷新时,上面的会随机出现不同的信息

<html><head>
<TITLE>randomadvice.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<%
generate a random number 1-6
randomize
randomnum=int(rnd*6)+1
SELECT CASE randomnum
CASE 1,2,3%>
   Plant your crops early this year<br>
   No frost expected<br>
<%CASE 4%>
   Never play cards<br>with a man named after a city<br>
<%CASE 5%>
   You can never be too rich, too thin or backup too often<br>
<%CASE 6%>
   A swallow keeps away the stork<br>
<%END SELECT%>
</body></html>  

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 产生随机滚动信息_asp技巧
分享到: 更多 (0)