PC Review


Reply
Thread Tools Rate Thread

Check Status of Service in VB.Net

 
 
=?Utf-8?B?U1FMU2NvdHQ=?=
Guest
Posts: n/a
 
      27th Oct 2004
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
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      27th Oct 2004
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" <(E-Mail Removed)> wrote in message
newsA5AA71E-6C5D-473E-8399-(E-Mail Removed)...
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


 
Reply With Quote
 
=?Utf-8?B?U1FMU2NvdHQ=?=
Guest
Posts: n/a
 
      27th Oct 2004
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" <(E-Mail Removed)> wrote in message
> newsA5AA71E-6C5D-473E-8399-(E-Mail Removed)...
> 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check the status of the UDP port status tsgd84 Windows Networking 0 2nd Jul 2008 02:35 PM
question about script for check service status FPL Microsoft Windows 2000 CMD Promt 1 6th Nov 2007 05:47 PM
c# app to check web status... trint Microsoft C# .NET 10 14th Feb 2007 03:03 PM
Check Box Status =?Utf-8?B?VG9t?= Microsoft Excel Programming 2 16th Feb 2005 11:17 PM
How to check the status of a service using a command line addbad@hotmail.com Microsoft Windows 2000 New Users 1 4th Jul 2004 10:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:44 AM.