
Windows services vs winforms issue .....
Ok Ive got a question that is haunting me.
I have built a VERY simple application to hit an internal webpage
every 30
seconds, this page executes a bunch of ADO commands, and it changes,
hence Ive put it in a web page, it works perfectly.
I built a winforms application with a timer that does the following.
Function DownloadPage(ByVal sCompleteURL As String) As String
Dim wDownload As System.Net.WebClient = New
System.Net.WebClient()
Dim bHTML As Byte() = wDownload.DownloadData(sCompleteURL)
Dim sWebPage As String =
System.Text.Encoding.ASCII.GetChars(bHTML)
Return sWebPage
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Try
DownloadPage("http://localhost/smoa/ed.asp")
Catch
' Here I am going to send an alert if there was an error.
End Try
End Sub
Works like a charm........
NOW When I build it as a service and set the timer to 30 seconds (same
as winforms)
I does ABSOLUTTLEY NOTHING, it runs as a service fine, it installs
fine, it just does nothing ....
I Have built and rebuilt it and same results, I have built services
under VB.NET before and they are all running along happily this one
just does not.
Can anyone see a reason as to why it would work fine on a form but not
as a service ?
I am turning the timer on on_start I can see a blip in my cpu on
schedule, it just doesnt do anything.
Any Ideas ?????
Chris