Click here to Skip to main content
15,868,048 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello i'm trying to work with Autoupdate .net source code,
But i cannot figure out how to make the program itself with a timer to check on specific time the update function.
They present this code as base, but i cannot convert it to vb.net and find a way to make it correct, can someone help me out how should i make it correct?

System.Timers.Timer timer = new System.Timers.Timer
{
    Interval = 2 * 60 * 1000,
    SynchronizingObject = this
};
timer.Elapsed += delegate
{
    AutoUpdater.Start("http://rbsoft.org/updates/AutoUpdaterTest.xml");
};
timer.Start();


What I have tried:

Try normal tick to call the autoupdater.start but not good, cannot make it on specific time to call it
Posted
Updated 12-Nov-19 7:01am
Comments
Richard MacCutchan 12-Nov-19 12:28pm    
If you show us the VB.NET code we may be able to make some suggestions.
diablo22 12-Nov-19 12:44pm    
the default code that comes with autoupdate .net is added in first post somehow i'm trying to figure it out how to make it in vb.net

When form loads after specific time to check for updates (to call this timer)

1 solution

Imports AutoUpdaterDotNET

Public Class Class1
    Private WithEvents xTimer As New System.Windows.Forms.Timer

    Public Sub New(TickValue As Integer)
        xTimer = New System.Windows.Forms.Timer
        xTimer.Interval = TickValue
    End Sub

    Public Sub StartTimer()
        xTimer.Start()
    End Sub

    Public Sub StopTimer()
        xTimer.Stop()
    End Sub

    Private Sub Timer_Tick() Handles xTimer.Tick
        SampleProcedure()
    End Sub

    Private Sub SampleProcedure()
        AutoUpdater.Start("webpage")
    End Sub

End Class


In Form Panel:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim xSub As New Class1(60000) ' 1000 ms = 1 sec so 60000 ms = 1 min
        xSub.StartTimer
    End Sub


Works for me :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900