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

Home Posts Topics Members FAQ

Check Status of Service in VB.Net

I have a VB6 app that uses API calls to check that status of certain
Services. I am converting this app to VB.Net and wondering how to accomplish
this same functionality in VB.Net.

Any ideas?
--
Thanks,

Scott
Nov 21 '05 #1
2 6122
Hi,

Dim s As System.ServiceProcess.ServiceController

For Each s In System.ServiceProcess.ServiceController.GetDevices

Dim strOut As String = String.Format("{0} {1} {2}", s.ServiceName, s.Status,
s.ServiceType)

Trace.WriteLine(strOut)

Next

Ken

-----------------------

"SQLScott" <SQ******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I have a VB6 app that uses API calls to check that status of certain
Services. I am converting this app to VB.Net and wondering how to
accomplish
this same functionality in VB.Net.

Any ideas?
--
Thanks,

Scott
Nov 21 '05 #2
Thanks Ken. Very helpful. That gave me 99% of what I needed, but I have one
more question.

How can I tell if a service is "hung"? I know I can check the status which
will tell me whether it is running or not, but I need to be able to determine
if the service is responding. Does this make sense?

Thanks so much for your help. Very much appreciated.

Scott

"Ken Tucker [MVP]" wrote:
Hi,

Dim s As System.ServiceProcess.ServiceController

For Each s In System.ServiceProcess.ServiceController.GetDevices

Dim strOut As String = String.Format("{0} {1} {2}", s.ServiceName, s.Status,
s.ServiceType)

Trace.WriteLine(strOut)

Next

Ken

-----------------------

"SQLScott" <SQ******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I have a VB6 app that uses API calls to check that status of certain
Services. I am converting this app to VB.Net and wondering how to
accomplish
this same functionality in VB.Net.

Any ideas?
--
Thanks,

Scott

Nov 21 '05 #3

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

Similar topics

4
57078
by: Christian Eriksson | last post by:
Hi! I want to clarify, for myself, some basic facts about Oracle Client Server configuration. I start with the listener configuration on the server side. What block(s) in what configuration...
4
15002
by: Lucas Tam | last post by:
Hi all, If I create a serviceController like: srvController = New ServiceController("Fubar") serviceController will be created regardless if the service exists or not. It will only throw an...
1
7740
by: aaa | last post by:
What is the most efficient way to do a check to see if a webservice exists before attempting to execute. I was thinking of just creating an HTTP object then initiating a request to see if i get a...
7
25624
by: Joris De Groote | last post by:
Hi, can vb check if a windows service is running or not? ( Webclient ) Thanks Joris
12
14501
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
4
1287
by: www.gerardvignes.com | last post by:
I'd like to join or start a small group of Ajax web developers who are willing to smoke test each others Ajax applications, quid pro quo. I can smoke test on W2K SP4 with IE6, FF2, SM 1 and O9. ...
9
14881
by: awel | last post by:
Hi, I'm new in python and I would like to know if it's possible to check if a specific windows service is present and if it's possible how can I do? Thanks
9
1765
by: Ethan Strauss | last post by:
Hi, I have a web service which is doing a lot of processing and taking 4-5 minutes to do so. The processing is split into several discrete steps and I would like for the service to be able to tell...
4
11272
by: Sir C4 | last post by:
Can someone give a quick example of how to check for activity on a TCP port? For example, I'd like to watch and listen for activity on port 80. Once activity is detected, I'd like an event to be...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
5631
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,...
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
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.