Windows Service : Timer - Should it work ???

M

Mr Newbie

I have a Windows Service and I am using a Timer on it with an interval of 10
seconds. The assembly has full trust and the service is running under the
localmachine permission.

In the timer tick I have the following code.

Dim fs As New System.IO.FileStream("C:\ticking.txt", IO.FileMode.Append)

Dim sw As New System.IO.StreamWriter(fs)

sw.WriteLine("im tickin")

sw.Flush()

///

I have the timer enabled and have used the

Timer1.Start() in the OnStart sub routine.

It does not work, any ideas !!!!!!!!!!!!
 
C

Cor Ligthert [MVP]

Herfried,

If you look in the newsgroup than you can see that it was a windows form
timer.
Please keep the answers to the original thread.

Thanks in advance

Cor
 
C

Cor Ligthert [MVP]

Mr Newbie,

To get the best answers you can better keep your questions to the original
threads, than everybody can see what answers are already given. This is not
a new subject.

Thanks in advance

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
If you look in the newsgroup than you can see that it was a windows form
timer.
Please keep the answers to the original thread.

I don't read every thread posted to this group...
 
M

Mr Newbie

Very sorry to have made this error. I am soldiering on with the other timer
classes now and having not much more success. However, it appears to be very
hit and miss as to if the service will run at all and if debugging allways
works.

Very crap I must say ;-(

Thanks to all for your assistance.


Regards - Mr Newbie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top