Ir para conteúdo
Fórum Script Brasil
  • 0

Uma ajuda nets sript


arldin

Pergunta

Olha amigos estou precidando de uma ajuda, eu tenho este script de global.asa, para usuario online, a ajuda que eu estou precisando e a sequinte. O script funciona bem, so que ele so faz a atualização depois de 1(um) minuto, gostaria de saber se tem como altera-lo para que guando o usuario entrar e sair ele atualiza de imediato

Aqui esta o script

<script LANGUAGE="VBScript" RUNAT="Server">

'The code in this section is for when the server starts or the first user uses your site

'any variables in the Application_OnStart will remain till the server is stopped or the server is rebooted

Sub Application_OnStart

'Craete an ActiveUsersNumber variable with Application scope and set it to 0

Application("intActiveUserNumber") = 0

End Sub

'The code in this section is for when a user connects to any page in your web site

Sub Session_OnStart

'The session timeout is how long a session (user connection) to your web site will last. The defualt is 01 minutes

'When you call a web page a connection is made when the page is finshed downloading the connection is dropped

'if the session time out is set two low you wont register active users while they are reading a page

'if you set it two high you will still register users as active after they have left your site

'It is pobally best to leave at the defualt 01 minutes so that it dosent effect any other session variables used in your web site

Session.Timeout = 01

'The appilcation must be locked so that only one user can increment the Application ActiveUserNumber variable at a time

Application.Lock

'The Application ActiveUserNumber variable is incremented by 1

Application("intActiveUserNumber") = Application("intActiveUserNumber") + 1

'The application is now unlocked

Application.UnLock

End Sub

'The code in this section is for when a user leaves yoursite or the session times out which ever comes first.

'Usally with HTTP access the server can not tell when a user has left the site so will wait for the session to time out

Sub Session_OnEnd

'The appilcation must be locked so that only one user can decrement the Application ActiveUserNumber variable at a time

Application.Lock

'The Application ActiveUserNumber variable is decremented by 1

Application("intActiveUserNumber") = Application("intActiveUserNumber") - 1

'The application is now unlocked

Application.UnLock

End Sub

</SCRIPT>

Desde já agradeço a todos

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
Acredito que a única maneira de se fazer isso é o usuário clicar em algo para sair do sistema, como ele tem a opção de fechar o browser, a melhor maneira, e acho que a única, é este de tempo em tempo.

Abraços...

E que eu faço, mais gostaria de saber se tem um geito de isto ser feito sem que eu tenha que ficar saindo e entrando

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...