Hi everyone,
I've created a windows service with a timer which opens a IE browser window targeted at a specific page/script. It works if I run the executable itself, however when I install it as a service using InstallUtil and then manually start the service it does not work.
Any thoughts, suggestions or fixes would be really helpful.
Code from the service.vb file is below.
Thanks!
I've created a windows service with a timer which opens a IE browser window targeted at a specific page/script. It works if I run the executable itself, however when I install it as a service using InstallUtil and then manually start the service it does not work.
Any thoughts, suggestions or fixes would be really helpful.
Code from the service.vb file is below.
Thanks!
Code:
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
Timer1.Enabled = True
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
Timer1.Enabled = False
End Sub
'Set variables for use in the Tracker
Public Explorer As SHDocVw.InternetExplorer
Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
Explorer = New SHDocVw.InternetExplorer
Explorer.Visible = True
Explorer.Navigate("http://www.microsoft.com")
End Sub