473,508 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timer control - windows service (no form)

10 New Member
Hi, Could anyone assist me. I wrote a windows application and is tested successfully. This app must run as a windows service, so I copied the code into a new "windows service project" The problem is with the timer control.
These lines result in errors as no form exists. How can I use a timer "control" in a service.? (vb.net) Much appreciation.

Here is a snippet of the in error code:

Friend WithEvents timerRefresh As System.Windows.Forms.Timer

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Me.timerRefresh = New System.Windows.Forms.Timer(Me.components)
Sep 7 '06 #1
3 6888
Francois Stander
10 New Member
[Sorry, my mistake
Sep 8 '06 #2
Luceafaru
12 New Member
Use
System.Timers.Timer object instead of System.Windows.Forms.Timer.

Paul


Hi, Could anyone assist me. I wrote a windows application and is tested successfully. This app must run as a windows service, so I copied the code into a new "windows service project" The problem is with the timer control.
These lines result in errors as no form exists. How can I use a timer "control" in a service.? (vb.net) Much appreciation.

Here is a snippet of the in error code:

Friend WithEvents timerRefresh As System.Windows.Forms.Timer

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Me.timerRefresh = New System.Windows.Forms.Timer(Me.components)
Sep 8 '06 #3
dankyy1
3 New Member
thnx man that is right windows control timer doesn't respond in windows service....system.timers.timer works fine.....
Sep 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2477
by: ray | last post by:
Hi, I just wrote a windows service application to call a function of another object periodically. I used System.Server.Timer and I found that it works fine within the first 2 hours but the...
1
1482
by: Jiho Han | last post by:
I have a windows service that creates and starts a timer. And when the timer has elapsed, it performs a few things and resets the timer. (AutoReset = false, so it only executes once). However,...
2
8454
by: hnkien | last post by:
Hi, I am writing a windows service with threading.timer for 10 seconds but it didn't work. Here are my code: namespace SchedulerService { public class ScheduleService :...
1
1924
by: sidd | last post by:
Hi all, how do i exit out(unload) of a windows service in case of an error. so i have a code block as follows try { } catch(exception ex) { //log to event log
7
1825
by: Ha ha | last post by:
how can i control a windows service through a web page, for example: start a service stop a service thanks *** Sent via Developersdex http://www.developersdex.com *** Don't just participate...
5
5074
by: Dhilip Kumar | last post by:
Hi all, I have developed a windows service using the windows service project template in VS.NET. I have used three controls in the service, a timer, performance counter and a message queue...
1
1776
by: Roland | last post by:
Hi, I have written a Windows Service with a Timer (System). The Interval is set to 60000 (60 seconds) for testing. In the Timer1_Elapsed event I execute a task. In this case I have to read a...
0
934
by: prowyh | last post by:
Hi, all, I am struggling with the problem controlling Windows Service through Web Service, such as the following code snippet: ServiceController sc = new ServiceController(); sc.ServiceName =...
1
3269
by: sarabonn | last post by:
Hallo everyone, I am using vs 2005 with vb.net. I want to run a windows service once a day automatically. I used the threading timer and it runs perfect for the first and does not run...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7328
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
7388
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
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.