Click here to Skip to main content
15,887,485 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Pete O'Hanlon18-Sep-13 3:26
mvePete O'Hanlon18-Sep-13 3:26 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661318-Sep-13 3:37
professionalsteve_949661318-Sep-13 3:37 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661318-Sep-13 23:11
professionalsteve_949661318-Sep-13 23:11 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Pete O'Hanlon18-Sep-13 23:27
mvePete O'Hanlon18-Sep-13 23:27 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661319-Sep-13 0:00
professionalsteve_949661319-Sep-13 0:00 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Pete O'Hanlon19-Sep-13 0:09
mvePete O'Hanlon19-Sep-13 0:09 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661319-Sep-13 1:39
professionalsteve_949661319-Sep-13 1:39 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Pete O'Hanlon20-Sep-13 1:11
mvePete O'Hanlon20-Sep-13 1:11 
Try changing your class so that it looks like this:
VB
Public Class CWebUser
 
  Private mUserName As String = ""         'nome utente
  Private mPassword As String = ""         'MD5 della password 
  Private mIP As String = ""               'IP di provenienza della connessione
  Private mStartSession As Long = 0        'istante di inizio della connessione come ticks
  Private mLogged As Boolean = False       'flag per sapere se l'utente è loggato
  Private WithEvents mWUTimer As System.Windows.Forms.Timer   'timer per gestire la durata della connessione

  Sub New()
  End Sub
 
  Private Sub WUTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
    If ((DateTime.Now.Ticks - mStartSession) > (CGlobali.WebSessionDuration * 10000000)) Then
      mWUTimer.Enabled = False
      mIP = ""
      mLogged = False
    End If
  End Sub
 
  Public Property UserName() As String
    Get
      Return mUserName
    End Get
    Set(ByVal value As String)
      mUserName = value
    End Set
  End Property
 
  Public Property Password() As String
    Get
      Return mPassword
    End Get
    Set(ByVal value As String)
      mPassword = value
    End Set
  End Property
 
  Public Property IP() As String
    Get
      Return mIP
    End Get
    Set(ByVal value As String)
      mIP = value
    End Set
  End Property
 
  Public Property StartSession() As Long
    Get
      Return mStartSession
    End Get
    Set(ByVal value As Long)
      mStartSession = value
    End Set
  End Property
 
  Public Property Logged() As Boolean
    Get
      Return mLogged
    End Get
    Set(ByVal value As Boolean)
      mLogged = value
    End Set
  End Property
 
  Public Property WUTimer() As System.Windows.Forms.Timer
    Get
      Return mWUTimer
    End Get
    Set(ByVal value As System.Windows.Forms.Timer)
      mWUTimer = value
    End Set
  End Property
 
  Public Sub EnableTimer(Byval IpAddress As String, ByVal Name As String)
    IP = IpAddress
    UserName = Name
    mWUTimer = New System.Windows.Forms.Timer()
    mWUTimer.Interval = 10000
    AddHandler (mWUTimer.Tick), AddressOf WUTimer_Tick
    mWUTimer.Enabled = True
  End Sub
End Class
Then call EnableTimer from your loop.

GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661320-Sep-13 2:29
professionalsteve_949661320-Sep-13 2:29 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661323-Sep-13 4:51
professionalsteve_949661323-Sep-13 4:51 
AnswerRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Eddy Vluggen19-Sep-13 0:28
professionalEddy Vluggen19-Sep-13 0:28 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661319-Sep-13 1:52
professionalsteve_949661319-Sep-13 1:52 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Eddy Vluggen19-Sep-13 2:59
professionalEddy Vluggen19-Sep-13 2:59 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
steve_949661319-Sep-13 4:02
professionalsteve_949661319-Sep-13 4:02 
GeneralRe: [VB.NET 2008] A runtime created Timer doesn't work Pin
Eddy Vluggen19-Sep-13 4:57
professionalEddy Vluggen19-Sep-13 4:57 
Questionfinding a range between 2 special characters Pin
nagham_4ng17-Sep-13 22:53
nagham_4ng17-Sep-13 22:53 
AnswerRe: finding a range between 2 special characters Pin
Eddy Vluggen18-Sep-13 0:32
professionalEddy Vluggen18-Sep-13 0:32 
GeneralRe: finding a range between 2 special characters Pin
nagham_4ng18-Sep-13 19:24
nagham_4ng18-Sep-13 19:24 
GeneralRe: finding a range between 2 special characters Pin
Eddy Vluggen19-Sep-13 0:28
professionalEddy Vluggen19-Sep-13 0:28 
Questionc# .net RichtextBox Pin
Member 774863016-Sep-13 9:02
Member 774863016-Sep-13 9:02 
AnswerRe: c# .net RichtextBox Pin
Eddy Vluggen18-Sep-13 0:28
professionalEddy Vluggen18-Sep-13 0:28 
GeneralRe: c# .net RichtextBox Pin
Member 774863018-Sep-13 3:35
Member 774863018-Sep-13 3:35 
GeneralRe: c# .net RichtextBox Pin
Eddy Vluggen18-Sep-13 7:02
professionalEddy Vluggen18-Sep-13 7:02 
GeneralRe: c# .net RichtextBox Pin
Member 774863018-Sep-13 12:21
Member 774863018-Sep-13 12:21 
QuestionHelp Regarding Source Code Of Meshack Pin
Caiser Mahmood13-Sep-13 21:47
Caiser Mahmood13-Sep-13 21:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.