473,513 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check if Service is running?

Hi,

can vb check if a windows service is running or not? ( Webclient )

Thanks
Joris
May 10 '06 #1
7 25624
"Joris De Groote" <jo************@skynet.be> schrieb:
can vb check if a windows service is running or not? ( Webclient )


On the client or on the server? I doubt that this is possible on the client
without writing some ugly ActiveX control or .NET Browser Control. Maybe
it's better to develop a classic rich-client Windows Forms application
instead of a Web application.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 10 '06 #2
It's a VB.NET program that runs on a server, so it's not a web application.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eC**************@TK2MSFTNGP04.phx.gbl...
"Joris De Groote" <jo************@skynet.be> schrieb:
can vb check if a windows service is running or not? ( Webclient )


On the client or on the server? I doubt that this is possible on the
client without writing some ugly ActiveX control or .NET Browser Control.
Maybe it's better to develop a classic rich-client Windows Forms
application instead of a Web application.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 10 '06 #3
Joris,

If you set a reference to System.ServiceProcess, you could use a
function like this one below to check it. I use it in a service of
mine to check for dependency services.

Function CheckIfServiceIsRunning(ByVal serviceName As String) As
Boolean

Dim mySC As ServiceProcess.ServiceController
mySC = New ServiceProcess.ServiceController(serviceName)
If mySC.Status = ServiceProcess.ServiceControllerStatus.Stopped
Then
' Service isn't running
Return False
ElseIf mySC.Status =
ServiceProcess.ServiceControllerStatus.Running Then
' Service already running
Return True
End If

End Function

May 10 '06 #4
You'd also want to put that in a Try Catch block. You'll get an
exception if the service name is invalid IIRC.

May 10 '06 #5
So you are checking the server to verify this particular service is running
right?

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"Joris De Groote" <jo************@skynet.be> wrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...
It's a VB.NET program that runs on a server, so it's not a web
application.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eC**************@TK2MSFTNGP04.phx.gbl...
"Joris De Groote" <jo************@skynet.be> schrieb:
can vb check if a windows service is running or not? ( Webclient )


On the client or on the server? I doubt that this is possible on the
client without writing some ugly ActiveX control or .NET Browser Control.
Maybe it's better to develop a classic rich-client Windows Forms
application instead of a Web application.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


May 10 '06 #6
Thanks

"jayeldee" <ja******@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
You'd also want to put that in a Try Catch block. You'll get an
exception if the service name is invalid IIRC.

May 15 '06 #7
Yep
"vbnetdev" <vb******@community.nospam> wrote in message
news:eZ**************@TK2MSFTNGP05.phx.gbl...
So you are checking the server to verify this particular service is
running right?

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"Joris De Groote" <jo************@skynet.be> wrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...
It's a VB.NET program that runs on a server, so it's not a web
application.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eC**************@TK2MSFTNGP04.phx.gbl...
"Joris De Groote" <jo************@skynet.be> schrieb:
can vb check if a windows service is running or not? ( Webclient )

On the client or on the server? I doubt that this is possible on the
client without writing some ugly ActiveX control or .NET Browser
Control. Maybe it's better to develop a classic rich-client Windows
Forms application instead of a Web application.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>



May 15 '06 #8

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

Similar topics

3
3823
by: Andrew Weaver | last post by:
How do you change the port in which CDONTS will look for Microsoft SMTP server? I have Imail running on port 25, and I have SMTP service running on port 26. Any help you can provide me would be...
15
1992
by: Sims | last post by:
Hi, I have a service that need to access the current user registry from time to time. But a service only works as a SYSTEM and not as the current user. How can i change that? Or at the very...
0
1122
by: RiteshDotNet | last post by:
I have develop a window service in vb.net in window service, i am running executeing exe which is reside on same system its gives error while running that exe file I am pasting error below "...
1
1241
by: Stephen Corey | last post by:
I've got a windows service running as NetworkService on a WinXP Pro machine. Is there a way for it to find the Active Directory account of the logged on user? I don't mind switching the service to...
3
2191
by: jliusolar | last post by:
Hi I am trying to figure out why an application get this error when I am trying to open the application's asmx file from localhost. I don't have indexing service running(it set as manual and not...
0
1115
by: Jennyfer J Barco | last post by:
Hello, I have a .NET service running and sometimes, not very often I receive this error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not...
1
1007
by: Bob | last post by:
Two part question: 1- I'm in the process of creating a service app with VB.net VS2005 - MyService. I have a get and set property that can return values if I can access it. - MyProperty Question...
12
14502
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...
3
1555
by: Steve | last post by:
I have to move my web services to our QA server for testing. All of the existing web services are configured under a parent web site such as web sites --default web site --webservices -- all web...
2
11930
by: Bill Fuller | last post by:
I am trying to attach to a WCF Web Service running in virtual directory in my local dev box, but not sure how to do it. I tried setting a breakpoint on the .svc and attaching to the Inetinfo...
0
7257
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
7157
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
7379
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
7535
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
7098
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...
1
5084
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
4745
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
3232
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...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.