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

C#

 
GeneralAccess Share folder in c# Pin
mimimimilaw14-Feb-08 15:50
mimimimilaw14-Feb-08 15:50 
GeneralRe: Access Share folder in c# Pin
Ennis Ray Lynch, Jr.14-Feb-08 16:06
Ennis Ray Lynch, Jr.14-Feb-08 16:06 
GeneralDynamically refreshing a running assembly Pin
Skippums14-Feb-08 15:34
Skippums14-Feb-08 15:34 
GeneralRe: Dynamically refreshing a running assembly Pin
Expert Coming14-Feb-08 15:41
Expert Coming14-Feb-08 15:41 
QuestionLoadStringW Loading a Korean String...Results Scrambled but close.. Pin
Don6514-Feb-08 11:49
Don6514-Feb-08 11:49 
GeneralRe: LoadStringW Loading a Korean String...Results Scrambled but close.. Pin
Skippums14-Feb-08 12:10
Skippums14-Feb-08 12:10 
GeneralRe: LoadStringW Loading a Korean String...Results Scrambled but close.. Pin
Don6515-Feb-08 5:27
Don6515-Feb-08 5:27 
GeneralGetting the ServiceName on OnStart() in a Windows Services using C# Pin
exergonic14-Feb-08 11:16
exergonic14-Feb-08 11:16 
I have a C# windows services installer that creates a service based on command line input, e.g.:

Enter the numeric ID from the available inspection types to install or 'q' to quit:

1: Structural Areas
2: Electrical Inspection Areas
3. Roof Inspection Areas
4. ...and so on

=> user chooses #3 "Roof Inspection Areas" and the service is created with service name of: RoofInspectionAreas. (hypothetical).

(Assume that my installer was used to create three services altogether: StructuralAreas, ElectricalInspectionAreas, and RoofInspectionAreas. Also assume that none of these services have been started.)

Now when RoofInspectionAreas service is selected to be started from the Windows Services Management Tool, the OnStart() method will perform a lookup in the custom config area of the app.config file to initialize some vars based the current service, e.g.:

<RoofInspectionAreas>
<add key="SweepFolderTime" value="600000"/>
<add key="Recurrence" value="5"/>
...and so on
</RoofInspectionAreas>

My question is: How do I get the current service name, i.e.: RoofInspectionAreas, of the service that is starting (so I can get the right custom config section) without knowing what service was selected to be started? All the examples I have found so far only show how to get a "listing" of services on the current machine.
GeneralRe: Getting the ServiceName on OnStart() in a Windows Services using C# Pin
PIEBALDconsult14-Feb-08 13:14
mvePIEBALDconsult14-Feb-08 13:14 
GeneralC# console application get ping results Pin
Member 154183814-Feb-08 9:24
Member 154183814-Feb-08 9:24 
GeneralRe: C# console application get ping results Pin
PIEBALDconsult14-Feb-08 13:08
mvePIEBALDconsult14-Feb-08 13:08 
GeneralRe: C# console application get ping results Pin
Member 154183815-Feb-08 2:59
Member 154183815-Feb-08 2:59 
Generalitem height distance Pin
netJP12L14-Feb-08 9:03
netJP12L14-Feb-08 9:03 
GeneralRe: item height distance Pin
Christian Graus14-Feb-08 9:30
protectorChristian Graus14-Feb-08 9:30 
GeneralRe: item height distance Pin
netJP12L14-Feb-08 9:42
netJP12L14-Feb-08 9:42 
GeneralRe: item height distance Pin
netJP12L14-Feb-08 10:07
netJP12L14-Feb-08 10:07 
GeneralRe: item height distance Pin
Christian Graus14-Feb-08 10:16
protectorChristian Graus14-Feb-08 10:16 
General[Message Deleted] Pin
lgauri14-Feb-08 8:30
lgauri14-Feb-08 8:30 
GeneralRe: Plsssssssss read the first message in the forum Pin
led mike14-Feb-08 9:07
led mike14-Feb-08 9:07 
JokeRe: Plsssssssss read the first message in the forum Pin
Le centriste14-Feb-08 9:12
Le centriste14-Feb-08 9:12 
GeneralRe: Plsssssssss read the first message in the forum Pin
BadKarma14-Feb-08 9:29
BadKarma14-Feb-08 9:29 
GeneralRe: Plsssssssss read the first message in the forum Pin
Guffa14-Feb-08 11:19
Guffa14-Feb-08 11:19 
GeneralSliding Form Pin
padz14-Feb-08 8:05
padz14-Feb-08 8:05 
GeneralRe: Sliding Form Pin
led mike14-Feb-08 9:08
led mike14-Feb-08 9:08 
GeneralRe: Sliding Form [modified] Pin
padz14-Feb-08 12:41
padz14-Feb-08 12:41 

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.