473,666 Members | 2,257 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 6132
Hi,

Dim s As System.ServiceP rocess.ServiceC ontroller

For Each s In System.ServiceP rocess.ServiceC ontroller.GetDe vices

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

Trace.WriteLine (strOut)

Next

Ken

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

"SQLScott" <SQ******@discu ssions.microsof t.com> wrote in message
news:DA******** *************** ***********@mic rosoft.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.ServiceP rocess.ServiceC ontroller

For Each s In System.ServiceP rocess.ServiceC ontroller.GetDe vices

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

Trace.WriteLine (strOut)

Next

Ken

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

"SQLScott" <SQ******@discu ssions.microsof t.com> wrote in message
news:DA******** *************** ***********@mic rosoft.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
57111
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 file(s) defines the services (shown below)? What causes there to be more than one instance of a service (shown
4
15017
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 exception if I access the properties of the serviceController.
1
7754
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 response back from the server. Is this too much overhead, and how would you imlement this?
7
25640
by: Joris De Groote | last post by:
Hi, can vb check if a windows service is running or not? ( Webclient ) Thanks Joris
12
14523
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 check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it happens I can programmatically start the same service on another machine.
4
1291
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. I need the following smoke tests: IE7 on XP (are they SP1 or SP2 now?) IE and FF on VISTA (any SPs yet?) SAF, IE and FF on MAC (Panther, Tiger, ...?) KON and FF on LINUX (Debian, Ubuntu, ...?)
9
14944
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
1771
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 the client when it is done with each step. I have tried to do this in a couple of ways and neither have worked. Any ideas how I might get it to work? What I have tried was:
4
11282
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 triggered. Thanks in advanced.
0
8440
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8866
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8638
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5662
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4193
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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 we have to send another system
2
1769
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.