产生随机滚动信息
类别: ASP教程
本页演示了通过产生随机数的方式实现出现随机滚动信息的方法
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>
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>
- 上一篇: 用ASP打开远端MDB文件
- 下一篇: 用ASP随机产生随机数
-= 资 源 教 程 =-
文 章 搜 索