473,769 Members | 5,869 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 25661
"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******** ******@TK2MSFTN GP04.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.ServiceP rocess, 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 CheckIfServiceI sRunning(ByVal serviceName As String) As
Boolean

Dim mySC As ServiceProcess. ServiceControll er
mySC = New ServiceProcess. ServiceControll er(serviceName)
If mySC.Status = ServiceProcess. ServiceControll erStatus.Stoppe d
Then
' Service isn't running
Return False
ElseIf mySC.Status =
ServiceProcess. ServiceControll erStatus.Runnin g 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******** ******@TK2MSFTN GP04.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******** ******@TK2MSFTN GP04.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******** *************@e 56g2000cwe.goog legroups.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******@commu nity.nospam> wrote in message
news:eZ******** ******@TK2MSFTN GP05.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******** ******@TK2MSFTN GP04.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******** ******@TK2MSFTN GP04.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
3834
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 excellent. Thanks, -Drew
15
2020
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 least get the service to launch an application as the current user and not the SYSTEM Many thanks
0
1141
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 " Unknown software exception (0xx06d07e) occurred in application at location 0x77e73862 In Just intime Debugger
1
1257
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 run as a "Domain Admin" if needed, but I *need* to find out the LDAP path for the user. Thanks!
3
2211
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 started). I also created an .aspx file to do testing The .aspx file opens fine in other directory from IE. As long as I put it in the application's directory, set a virtual directory trying to open it, it also gives me the following error. I don't...
0
1125
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 responding. General network error. Check your network documentation" I don't know what is causing it. My web server is in one server and my SQL is in a different server. The SQL server has not so many transactions. This service is reading a table every...
1
1016
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 is from another application, on another machine how can I get and set Myproperty on the service while its running? 2- The service does not have a UI, but sometimes it will be necessary for me to modify some of its configuration settings while...
12
14536
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.
3
1570
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 services The web service directory is configured for .NET 1.1, my new web services are .NET 2.0, I made the change on the ASP.NET to .NET 2.0 for my new web services, but I still can't run them. Do I need to create a new folder for my .NET 2.0 web...
2
11944
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 process, but it doesn't break. I am getting a SQL connection error, but the message is rather vague. The web.config connecton string looks fine.
0
9579
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
9416
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
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...
0
9849
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
6661
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
5293
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
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
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
3551
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.