USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  ASP - Active Server Page
Voltar
Autor Assunto:  Gerar aleatorio...
Gu§t@vo
JUNDIAÍ
SP - BRASIL
Postada em 02/07/2004 14:21 hs            
Olá,
Estou com um problema. Preciso gerar um numero aleatório que va de 1 ate o numero que esteja contido em uma variável.
Tipo:
<var> = 2
gerar um numero aleatorio, ou seja, 1 ou 2. Sortear.
     
vilmarbr
Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 02/07/2004 14:59 hs         
use isso e adapte:
<%
'Include p/ montar banner aleatório.
Dim iRandom
Randomize
iRandom = Int((Rnd * 7) + 1)
If iRandom = 1 then
 Response.Redirect ("banners/cdm.swf")
ElseIf iRandom = 2 then
 Response.Redirect ("banners/cdm.swf")
ElseIf iRandom = 3 then
 Response.Redirect ("banners/banner_erros.swf")
ElseIf iRandom = 4 then
 Response.Redirect ("banners/banner_demostracao.swf")
ElseIf iRandom = 5 then
 Response.Redirect ("banners/banner_port.swf")
ElseIf iRandom = 6 then
 Response.Redirect ("banners/cdm.swf")
ElseIf iRandom = 7 then
 Response.Redirect ("banners/banner_skype.swf")
End If
%>

http://www.vilmarbro.com.br
     
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página