<?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>GeoAvila (Geovanny G. Avila) &#187; Saber servicios de windows</title>
	<atom:link href="http://geoavila.com/tag/saber-servicios-de-windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://geoavila.com</link>
	<description>Desarrollo.. de software.</description>
	<lastBuildDate>Tue, 13 Sep 2011 21:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Listar Servicios de Windows con .Net</title>
		<link>http://geoavila.com/listar-servicios-de-windows-con-net/</link>
		<comments>http://geoavila.com/listar-servicios-de-windows-con-net/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 22:26:00 +0000</pubDate>
		<dc:creator>GeoAvila</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Saber servicios de windows]]></category>
		<category><![CDATA[Servicios de Windows .net]]></category>

		<guid isPermaLink="false">http://geoavila.com/2009/08/14/listar-servicios-de-windows-con-net/</guid>
		<description><![CDATA[Bueno una función que nos puede ayudar en determinado momento es listar los servicios activos de Windows un ejemplo sencillo de como hacerlo es hacer usando System.Serviceprocess (NO olvides agregarlo [...]]]></description>
			<content:encoded><![CDATA[<p>Bueno una función que nos puede ayudar en determinado momento es listar los servicios activos de Windows un ejemplo sencillo de como hacerlo es hacer usando System.Serviceprocess (NO olvides agregarlo como referencia al proyecto):</p>
<pre class="brush: vb; title: ; notranslate">
Imports System
Imports System.ServiceProcess

Class Program
Private Shared Sub Main()
Dim services As ServiceController() = ServiceController.GetServices()

Console.WriteLine(&quot;Listado de los servicios corriendo : &quot;)
For Each service As ServiceController In services
If service.Status = ServiceControllerStatus.Running Then 'cambiar por ServiceControllerStatus.Stopped para ver inactivos
Console.WriteLine()
Console.WriteLine(&quot; Nombre de servicio: {0}&quot;, service.ServiceName)
Console.WriteLine(&quot; Nombre mostrado: {0}&quot;, service.DisplayName)
End If
Next
End Sub
End Class </pre>
<p>y en c# sería así.</p>
<pre class="brush: csharp; title: ; notranslate">

using System;
using System.ServiceProcess;

class Program
{
static void Main()
{
ServiceController[] services = ServiceController.GetServices();

Console.WriteLine(&quot;Listado de los servicios corriendo : &quot;);
foreach (ServiceController service in services)
{
if (service.Status == ServiceControllerStatus.Running) //cambiar por ServiceControllerStatus.Stopped para ver inactivos
{
Console.WriteLine();
Console.WriteLine(&quot; Nombre de servicio: {0}&quot;,
service.ServiceName);
Console.WriteLine(&quot; Nombre mostrado: {0}&quot;,
service.DisplayName);
}
}
}
}
</pre>
<p>para saber los procesos que están inactivos usamos la siguiente propiedad.<br />
ServiceControllerStatus.Stopped.</p>
<p>un buen truco espero les sirva.</p>
]]></content:encoded>
			<wfw:commentRss>http://geoavila.com/listar-servicios-de-windows-con-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

