<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>eXclusiveMinds &#187; Windows Services</title>
	<atom:link href="http://eXclusiveMinds.com/tag/windows-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://eXclusiveMinds.com</link>
	<description>eXclusive resource for programmers, developers and designers</description>
	<lastBuildDate>Sat, 13 Mar 2010 23:28:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to get list of windows services instelled on local computer in C#</title>
		<link>http://eXclusiveMinds.com/2009/12/02/how-to-get-list-of-windows-services-instelled-on-local-computer-in-c/</link>
		<comments>http://eXclusiveMinds.com/2009/12/02/how-to-get-list-of-windows-services-instelled-on-local-computer-in-c/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 21:57:46 +0000</pubDate>
		<dc:creator>eXclusiveMinds</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Windows Services]]></category>

		<guid isPermaLink="false">http://eXclusiveMinds.com/?p=132</guid>
		<description><![CDATA[Following example demonstrate about getting list of installed windows services on local computer.

We can get the list of all installed services using static method ServiceContro­ller.GetServi­ces.

ServiceController&#91;&#93;  svcList = ServiceController.GetServices&#40;&#41;;

Example:
Following code example checks for installed services on local computer. First It gets a list of services and finds a services with specified name.

public static bool GetAllServices&#40;string [...]]]></description>
			<content:encoded><![CDATA[<p>Following example demonstrate about getting list of installed windows services on local computer.<br />
<span id="more-132"></span><br />
We can get the list of all installed services using static method <a href="http://msdn2.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.getservices.aspx">ServiceContro­ller.GetServi­ces</a>.</p>

<div class="wp_syntax"><table><tr><td><div class="code"><pre class="csharp" style="font-family:Consolas; monospace;">ServiceController<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>  svcList <span style="color: #008000;">=</span> ServiceController.<span style="color: #0000FF;">GetServices</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></td></tr></table></div>

<p><strong>Example:</strong></p>
<p>Following code example checks for installed services on local computer. First It gets a list of services and finds a services with specified name.</p>

<div class="wp_syntax"><table><tr><td><div class="code"><pre class="csharp" style="font-family:Consolas; monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">bool</span> GetAllServices<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> svcName<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  ServiceController<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> svcList <span style="color: #008000;">=</span> ServiceController.<span style="color: #0000FF;">GetServices</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
  <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>ServiceController svc <span style="color: #0600FF;">in</span> svcList<span style="color: #000000;">&#41;</span>
  <span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>svc.<span style="color: #0000FF;">ServiceName</span> <span style="color: #008000;">==</span> svcName<span style="color: #000000;">&#41;</span>
      <span style="color: #0600FF;">return</span> true<span style="color: #008000;">;</span>
  <span style="color: #000000;">&#125;</span>
  <span style="color: #0600FF;">return</span> false<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></td></tr></table></div>

<img src="http://eXclusiveMinds.Com/?ak_action=api_record_view&id=132&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://eXclusiveMinds.com/2009/12/02/how-to-get-list-of-windows-services-instelled-on-local-computer-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
