Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
QuestionLOC Count Pin
Tojan8-Aug-06 5:09
Tojan8-Aug-06 5:09 
QuestionPrint Dialog for Web Forms? Pin
orentuil8-Aug-06 4:45
orentuil8-Aug-06 4:45 
Questionhow to store by ref parameter in object table/array? Pin
Osinnnn8-Aug-06 4:33
Osinnnn8-Aug-06 4:33 
AnswerRe: how to store by ref parameter in object table/array? Pin
S. Senthil Kumar8-Aug-06 5:49
S. Senthil Kumar8-Aug-06 5:49 
GeneralRe: how to store by ref parameter in object table/array? Pin
Osinnnn8-Aug-06 9:21
Osinnnn8-Aug-06 9:21 
QuestionCan you detect if a service is running? Pin
Stick^8-Aug-06 4:17
Stick^8-Aug-06 4:17 
AnswerRe: Can you detect if a service is running? Pin
led mike8-Aug-06 6:07
led mike8-Aug-06 6:07 
AnswerRe: Can you detect if a service is running? Pin
vineas8-Aug-06 6:55
vineas8-Aug-06 6:55 
It's fairly simple to do, and you can even start it programatically if need be, here's a small snippet that starts a service not running (you'll need to add proper error checking).


string serviceName = "SomeServiceName";

ServiceController sc = new ServiceController();
sc.ServiceName = serviceName;

if (sc.Status == ServiceControllerStatus.Stopped)
{
	// Start the service, and wait until its status is "Running".
	sc.Start();
	sc.WaitForStatus(ServiceControllerStatus.Running);
}


A little more searching on the ServiceController class, and you'll see what else you can do with services.

-----
In the land of the blind, the one eyed man is king.

GeneralRe: Can you detect if a service is running? Pin
Stick^8-Aug-06 16:29
Stick^8-Aug-06 16:29 
Questioncreating hyperlink in Excel to the next Worksheet Pin
AnnnS8-Aug-06 4:14
AnnnS8-Aug-06 4:14 
QuestionHow to put checkbox in datagrid through DataGridColoumnStyle Pin
indiaone8-Aug-06 3:30
indiaone8-Aug-06 3:30 
Questionemail Pin
minniemooo8-Aug-06 3:07
minniemooo8-Aug-06 3:07 
AnswerRe: email Pin
seee sharp8-Aug-06 3:24
seee sharp8-Aug-06 3:24 
GeneralRe: email Pin
minniemooo8-Aug-06 3:41
minniemooo8-Aug-06 3:41 
GeneralRe: email Pin
Drew McGhie8-Aug-06 5:18
Drew McGhie8-Aug-06 5:18 
QuestionDataGridView - how to enter invalid data in comboboxcell Pin
anderde8-Aug-06 3:00
anderde8-Aug-06 3:00 
QuestionC#'s Form Event Question Pin
mariodai3658-Aug-06 2:17
mariodai3658-Aug-06 2:17 
AnswerRe: C#'s Form Event Question Pin
Stefan Troschuetz8-Aug-06 3:13
Stefan Troschuetz8-Aug-06 3:13 
GeneralRe: C#'s Form Event Question Pin
Robert Rohde8-Aug-06 3:21
Robert Rohde8-Aug-06 3:21 
AnswerRe: C#'s Form Event Question Pin
Drew McGhie8-Aug-06 3:20
Drew McGhie8-Aug-06 3:20 
QuestionFile name Pin
minniemooo8-Aug-06 1:55
minniemooo8-Aug-06 1:55 
AnswerRe: File name Pin
Guffa8-Aug-06 2:08
Guffa8-Aug-06 2:08 
GeneralRe: File name Pin
Drew McGhie8-Aug-06 3:25
Drew McGhie8-Aug-06 3:25 
AnswerRe: File name Pin
Stefan Troschuetz8-Aug-06 2:13
Stefan Troschuetz8-Aug-06 2:13 
QuestionSend a file directly to printer Pin
Support1238-Aug-06 1:10
Support1238-Aug-06 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.