北京夏盟灯饰:继续求助关于asp的问题

来源:百度文库 编辑:高考问答 时间:2024/04/28 06:32:13
<%
function f(x)
f=x^2+2*x+1
end function
function randomint(i)
randomint=cint(i*rnd)
end function
%>
作为server-side include

<html>
<body>
<!--#include virtual="\ch07\mathfunction.asp"-->
<%=f(3)&"<br>"%>
<%=randomint(100)&"<br>"%>
</body>
</html>
中randomint(100)我的理解是没刷新一次页面应该出现不同的数字,但是结果却是一个不变的恒定值
那位达人帮忙解决,谢谢

当然,这种随机不是真正的随机,
function randomint(i)
temp = hour(now())*60+minute(now())
randomint=cint((i+temp)*rnd)%100
end function

这样随机性更大,没测试,你试一下

你那样是不行的,要加一个randomize的.
function randomint(i)
randomize
randomint=cint(i*rnd)
end function