473,390 Members | 1,361 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

I need help with this service problem

Hi,
I have created a service that runs fine when set to check every fre secs,
however, I set it to run every 2 hours but when I start the service it runs
only once.

This is how I am setting the 2 hours

Dim TimerItem As New System.Threading.Timer(TimerDelegate, 1, _
10000, 3600000)

Any ideas?

Thanks
Jul 21 '05 #1
2 1116
Are you sure you are restarting the timer once you have finsihed what you
need to do in the Timer1_Tick event? Have you assigned a method to this event?

HTH

Graham Harris

"Chris" wrote:
Hi,
I have created a service that runs fine when set to check every fre secs,
however, I set it to run every 2 hours but when I start the service it runs
only once.

This is how I am setting the 2 hours

Dim TimerItem As New System.Threading.Timer(TimerDelegate, 1, _
10000, 3600000)

Any ideas?

Thanks

Jul 21 '05 #2
This is a sample of what I am doing

On service startup I have

Dim TimerDelegate As New Threading.TimerCallback(AddressOf ExecuteTask)

Dim TimerItem As New System.Threading.Timer(TimerDelegate, 1, _
10000, 3600000)


Protected Sub ExecuteTask(ByVal obj As Object)

If (GetFileByFtp()) = True Then

ProcessFile(sFileName)

Kill("C:\" & sFileName)

Else

Exit Sub

End If

End Sub

Thats basically what I have.

"bmsgharr" wrote:
Are you sure you are restarting the timer once you have finsihed what you
need to do in the Timer1_Tick event? Have you assigned a method to this event?

HTH

Graham Harris

"Chris" wrote:
Hi,
I have created a service that runs fine when set to check every fre secs,
however, I set it to run every 2 hours but when I start the service it runs
only once.

This is how I am setting the 2 hours

Dim TimerItem As New System.Threading.Timer(TimerDelegate, 1, _
10000, 3600000)

Any ideas?

Thanks

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: sidd | last post by:
Hi All, i have some doubts on .net windows services.. please see if some one could help me understand this.. 1)is it possible to install a windows service which does not have a installer added...
1
by: Julia | last post by:
Hi I have a domain model and I am looking for the correct design patterns to use, The following is my domain model Server-> the is the thread boundaries,the server create a thread the...
11
by: dcinfinite | last post by:
Hi.. i've posted heaps previously about my IIS not running..i've resorted in formatting my computer..and now the IIS is working..but i have another issue now..is so frustrating.. now..when i...
1
by: Camilla | last post by:
I'm making one of my first web services (with C#) and need help getting started. I have received an idl file and a sdl file that describes the interface I need to implement... but how do I...
2
by: DD | last post by:
I have developed a a nice little software package(Packaged with Wise and SageKey) My product works great in a clean enviroment on Win98 and Win2k and XP As soon as i introduce Office 2000 Pro onto...
2
by: Owe Armandt | last post by:
I have a service where I start up the worker thread from OnStart and also stop the thread from OnStop. My problem is if the service by itself decides to stop because of some problem it cannot...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
5
by: hourlie | last post by:
I wrote a simple Web Service. It Consumes a single String, writes it to a text file on the hard drive, and returns a success. Now I need a trigger that will start the program that processes the...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.