Click here to Skip to main content
16,010,488 members
Home / Discussions / C#
   

C#

 
QuestionWhat's the C# v1 way of doing what a C# Nullable type will do in v2? Pin
nevdelap2-Feb-05 13:41
nevdelap2-Feb-05 13:41 
AnswerRe: What's the C# v1 way of doing what a C# Nullable type will do in v2? Pin
Robert Rohde2-Feb-05 19:43
Robert Rohde2-Feb-05 19:43 
GeneralRe: What's the C# v1 way of doing what a C# Nullable type will do in v2? Pin
nevdelap2-Feb-05 19:49
nevdelap2-Feb-05 19:49 
AnswerRe: What's the C# v1 way of doing what a C# Nullable type will do in v2? Pin
leppie2-Feb-05 20:10
leppie2-Feb-05 20:10 
GeneralServices Pin
StephenMcAllister2-Feb-05 13:27
StephenMcAllister2-Feb-05 13:27 
GeneralRe: Services Pin
Robert Rohde2-Feb-05 20:24
Robert Rohde2-Feb-05 20:24 
GeneralRe: Services Pin
Heath Stewart2-Feb-05 23:29
protectorHeath Stewart2-Feb-05 23:29 
GeneralRe: Services Pin
Heath Stewart2-Feb-05 23:39
protectorHeath Stewart2-Feb-05 23:39 
You do not necessarily have to stop a service when servicing your application, but a reboot will be required if you don't (to act on the pending file rename operation - or PFRO - that was scheduled since your service executable was in use).

Whether or not you can remotely update the service depends on what remote administrative tools you have set up. There's nothing built into Windows to enable this functionality directly, but you can use WMI to stop the service, use the Admin share (like \\SomeMachine\c$) to copy over the service executable, then use WMI to restart the service. This wouldn't require an interactive login, but your connecting user account would still be authenticated.

A strong word of caution (and this is an area I know well) - really evaluate what the minimum set of permissions are. Too many services often run as SYSTEM, which grants your service full administrative rights. It's highly discouraged to run as SYSTEM unless you have to. Run either as an interactive user (which allows you to create window stations in which to run Windows applications - visible or not), NetworkService (for basic rights + network privileges) or LocalService for a decent amount of privileges.

You can find a lot of information about Windows services - and just about everything else regarding Windows development - at http://msdn.microsoft.com[^].

For information specfic to services, see http://msdn.microsoft.com/library/en-us/dllproc/base/services.asp[^]. To learn more about the privileges granted to LocalSystem (SYSTEM), LocalService, and NetworkService see http://msdn.microsoft.com/library/en-us/dllproc/base/service_user_accounts.asp[^].

You can also create window stations (which host desktops, which are required for Windows applications) by running as SYSTEM and OR'ing the Type registry key with 256 (when I get time to finish it, I'll be releasing an article describing this in more detail) as I mentioned in my indirectly reply to your post. It is recommended in this case to impersonate the caller, typically calling ImpersonateLoggedOnUser which you'd have to P/Invoke.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
Questionhow can i show the character if a UNICIODE in textbox Pin
mirzaei2-Feb-05 12:11
mirzaei2-Feb-05 12:11 
AnswerRe: how can i show the character if a UNICIODE in textbox Pin
Heath Stewart2-Feb-05 23:49
protectorHeath Stewart2-Feb-05 23:49 
AnswerRe: how can i show the character if a UNICIODE in textbox Pin
Heath Stewart3-Feb-05 0:07
protectorHeath Stewart3-Feb-05 0:07 
GeneralJpeg images, YCbCr encoding, and .Net Pin
object882-Feb-05 12:09
object882-Feb-05 12:09 
GeneralRe: Jpeg images, YCbCr encoding, and .Net Pin
Christian Graus2-Feb-05 12:11
protectorChristian Graus2-Feb-05 12:11 
GeneralRe: Jpeg images, YCbCr encoding, and .Net Pin
object882-Feb-05 12:32
object882-Feb-05 12:32 
GeneralRe: Jpeg images, YCbCr encoding, and .Net Pin
Christian Graus2-Feb-05 12:36
protectorChristian Graus2-Feb-05 12:36 
GeneralRe: Jpeg images, YCbCr encoding, and .Net Pin
object883-Feb-05 10:00
object883-Feb-05 10:00 
GeneralAdding Class file Pin
dasmeher2-Feb-05 11:32
sussdasmeher2-Feb-05 11:32 
GeneralRe: Adding Class file Pin
Christian Graus2-Feb-05 11:48
protectorChristian Graus2-Feb-05 11:48 
GeneralRe: Adding Class file Pin
MyThread2-Feb-05 11:55
MyThread2-Feb-05 11:55 
GeneralRe: Adding Class file Pin
Christian Graus2-Feb-05 11:58
protectorChristian Graus2-Feb-05 11:58 
GeneralRe: Adding Class file Pin
MyThread2-Feb-05 12:07
MyThread2-Feb-05 12:07 
GeneralRe: Adding Class file Pin
Christian Graus2-Feb-05 12:10
protectorChristian Graus2-Feb-05 12:10 
GeneralRe: Adding Class file Pin
MyThread2-Feb-05 12:21
MyThread2-Feb-05 12:21 
GeneralRe: Adding Class file Pin
Christian Graus2-Feb-05 12:24
protectorChristian Graus2-Feb-05 12:24 
GeneralRe: Adding Class file Pin
MyThread2-Feb-05 12:29
MyThread2-Feb-05 12:29 

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.