月份那时 用ASP写了个摇奖程序 吸引人气 都写着什么 特等奖 摇中888 有Iphone4S拿 实际上是 主办方的推广营销吸引人气的方式 当然也有真给中的 但是这个结果 全是人为可以控制结果的 说什么每天送一部IPHOE4 实际上 可能永远都不送 因为不可能有人摇中 下面只是我写的时候用到的代码 再怎么随机抽 结果完全可以人为的 <% Function getRnd(N, M) '取N-M之间的随机数,M>=N getRnd = Int(Rnd() * (M - N + 1)) + N End Function
Function WriteRnd() Randomize '一定要初始化随机数,否则每次打开程序取出的数都一样的。 lotteryResult=Cstr(getrnd(1,9))+Cstr(getrnd(1,9))+Cstr(getrnd(1,9))
'控制结果www.2cto.com if(lotteryResult="888") then Response.Write("154") ‘摇中888 就改成154 用户这边永远中不了IPhone else if (lotteryResult="777") then Response.Write("132") else if (lotteryResult="666") then Response.Write("482") else'NO selected Response.Write(lotteryResult) end if end if end if
Copyright 2001-2010, www.comprg.com.cn, All Rights Reserved 京ICP备14022230号-1,电话/传真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
地址:北京市海淀区远大路20号宝蓝大厦E座704,邮编:100089