473,511 Members | 16,730 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Services

I have two questions regarding services.

First of.
Is there any problem with creating VB9 services running timer events om
Winxp?
I built a service App and it installs and runs but the timer events doesn´t
klick.

Lastly, how do I logon to another computer Win2003 Server and restart /
check status of a service.
Jun 27 '08 #1
4 982
On 2008-06-27, Tomas Andersson <to*************@heatex.comwrote:
I have two questions regarding services.

First of.
Is there any problem with creating VB9 services running timer events om
Winxp?
I built a service App and it installs and runs but the timer events doesn´t
klick.
What timer? System.Windows.Forms.Timer does NOT work in services. You need
to be using System.Threading.Timer or System.Timers.Timer.
Lastly, how do I logon to another computer Win2003 Server and restart /
check status of a service.
In what context? Programatically? As a user?

--
Tom Shelton
Jun 27 '08 #2
I tried both System.threading.timer and system.timers.timer and none seemed
to work

And I need to restart the service programmatically.

Here is the thing.

My program creates importfiles for another system. These files can have
multiple levels that has to be imported from the lowest level to the
highest. Therefore my program creates these imports and add them to a
database for temporary storage.

Another program then looks at the priority and dumps these files to a folder
where yet another program finds these files and imports them.

Problem is that this last step uses a little dodgy service that sometime
loses the connection to the importprogram, or rather the other way round.
Any who. The solution Is to restart the service so the connection goes up
again.

So when the middle program detects that there is imports cued in DB and a
already bumped importfile has not been touched for some time this should
restart the service

/Tomas

"Tom Shelton" <to*********@comcastXXXXXXX.netskrev i meddelandet
news:<f6******************************@comcast.com >...
On 2008-06-27, Tomas Andersson <to*************@heatex.comwrote:
I have two questions regarding services.
First of.
Is there any problem with creating VB9 services running timer events
om Winxp?
I built a service App and it installs and runs but the timer events
doesn´t klick.
>
What timer? System.Windows.Forms.Timer does NOT work in services.
You need to be using System.Threading.Timer or System.Timers.Timer.
>
Lastly, how do I logon to another computer Win2003 Server and
restart / check status of a service.
>
In what context? Programatically? As a user?
>
--
Tom Shelton

Jun 28 '08 #3

"Tomas Andersson" <to*************@heatex.comwrote in message
news:OD**************@TK2MSFTNGP04.phx.gbl...
>I tried both System.threading.timer and system.timers.timer and none seemed
to work
You must be doing something wrong.

>

And I need to restart the service programmatically.

Here is the thing.

My program creates importfiles for another system. These files can have
multiple levels that has to be imported from the lowest level to the
highest. Therefore my program creates these imports and add them to a
database for temporary storage.

Another program then looks at the priority and dumps these files to a
folder where yet another program finds these files and imports them.

Problem is that this last step uses a little dodgy service that sometime
loses the connection to the importprogram, or rather the other way round.
Any who. The solution Is to restart the service so the connection goes up
again.

So when the middle program detects that there is imports cued in DB and a
already bumped importfile has not been touched for some time this should
restart the service
You can use the Service Controller and stop or start a service running on
another machines. The programs would need to use an Admin account that's
active on both machines.

http://www.siccolo.com/Articles/Code...estart_NT.html

Jun 28 '08 #4
Tomas Andersson wrote:
Is there any problem with creating VB9 services running timer events om
Winxp?
There's no inherent problem - I do it all the time.
I built a service App and it installs and runs but the timer events doesn´t
klick.
One possibility is that your Timer /is/ firing, but that the timer's
Elapsed() routine cannot be JIT-loaded because there's a referenced Type
or Assembly missing. The Framework probably throws an exception about
this, but I've never managed to find anywhere in /my/ code that I can
/catch/ it!

Because of this, I only use a Timer /once/ to get me out of the
"Call-and-Return" structure invoked by the Service Control Manager to
/start/ the Server; after that, I use Sleep calls within my "main" routine:

Overrides Sub OnStart()
TimerX.Start()
End Sub

Sub TimerX_Elapsed( ... ) Handles TimerX.Elapsed
TimerX.Stop()

Do While Not m_bShutdownRequested

Try
DoSomethingUseful()
Catch ex as Exception
' Log it, or whatever
' Don't let the Service Process die
End Try

For i as integer = 1 to 15
System.Threading.Thread.Sleep( 1000 )
Next

Loop

End Sub

HTH,
Phill W.
Jun 30 '08 #5

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

Similar topics

4
2227
by: rbt | last post by:
How does one associate a "Description" with a Windows service written in Python? I've just started experimenting with Python services. Here's my code... copied straight from Mr. Hammond's "Python...
6
2540
by: cs | last post by:
I noticed there is some .net services on my winxp. One or two mention the CLR. Does that mean that my .net apps/services wont run before those services start? I need to run my service as early on...
0
2137
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use...
26
1861
by: Mr Newbie | last post by:
What do I need to run a web service on my PC ? I know I need the .NET Framework, but do I need IIS Running ?
3
6471
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
7
6003
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is...
3
4970
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
2055
by: sdstraub | last post by:
I have created 5 services in my project, in the 1st service I set servicestorun = array of all 5 services, I have a project installer with 5 service installers, one for each service. I have code...
0
1787
by: krishnaraju | last post by:
HI to all, please help me.its urgent requirement. my question is this is the wsdl file i got from our client.please see at bottom. when iam trying to access that webmethods iam getting...
1
2173
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading...
0
7355
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
7423
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...
1
7081
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...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
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.