'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
Private updateIp As Timer
Private domain As String = "Pelle"
Private token As String = "00000-00000-00000"
End Sub
Sub AppStart (Args() As String)
Log("Hello world!")
' Timer för Duckdns
updateIp.Initialize("UpdateIp", 10 * 60 * 1000) '10 minutes
updateIp.Enabled = True
UpdateIp_Tick
StartMessageLoop
End Sub
Sub UpdateIp_Tick()
Dim job As HttpJob
job.Initialize("", Me)
job.Download2("http://www.duckdns.org/update", Array As String("domains", domain, "token", token, "ip", ""))
wait for (job) JobDone(job As HttpJob)
If job.Success = True Then
Log("Update DuckDNS: " & job.GetString)
Else
Log("Error updating Duck DNS: " & job.ErrorMessage)
End If
job.Release
End Sub