Click here to Skip to main content
15,918,976 members
Home / Discussions / C#
   

C#

 
GeneralRe: MeasureItem is not called for menu [EDITED] Pin
Member 54677527-May-04 4:58
Member 54677527-May-04 4:58 
GeneralLDAP Authentication! Please Help Pin
rami2k26-May-04 22:13
rami2k26-May-04 22:13 
GeneralRe: LDAP Authentication! Please Help Pin
MrEyes27-May-04 0:34
MrEyes27-May-04 0:34 
GeneralRe: LDAP Authentication! Please Help Pin
rami2k27-May-04 5:03
rami2k27-May-04 5:03 
GeneralRe: LDAP Authentication! Please Help Pin
Dave Kreskowiak27-May-04 3:53
mveDave Kreskowiak27-May-04 3:53 
GeneralRe: LDAP Authentication! Please Help Pin
rami2k27-May-04 4:57
rami2k27-May-04 4:57 
GeneralRe: LDAP Authentication! Please Help Pin
Dave Kreskowiak27-May-04 5:21
mveDave Kreskowiak27-May-04 5:21 
GeneralRe: LDAP Authentication! Please Help Pin
Heath Stewart27-May-04 5:01
protectorHeath Stewart27-May-04 5:01 
The best way is to run your application as a Windows Service (see ServiceBase in the .NET Framework SDK). This makes sure that it runs all the time and is independent of an interactive session. You could run this as a NetworkService or another special username that has read permissions on the remote server. This is the best way to do this (believe me, I've done things like this before). Having an interactive program is not a good idea in this case.

Specifying a different user's credentials in .NET is not easy. While impersonation is possible, the .NET FCL (Framework Class Library) does not provide full functionality and forces you to P/Invoke a lot of native methods that you need to understand. Fortunately, the documentation for the WindowsIdentity.Impersonate method contains an example.

Still, though, running this program (rather, re-writing it) as a Windows Service running under a network account is a much better way since it runs entirely in the background and you can always use the SCM (ServiceControlManager) to send simple codes, or .NET Remoting for more advanced control and monitoring.

 

Microsoft MVP, Visual C#
My Articles
GeneralRemoting Help! Please help urgently! Pin
hprahul26-May-04 22:07
hprahul26-May-04 22:07 
GeneralRe: Remoting Help! Please help urgently! Pin
Heath Stewart27-May-04 4:56
protectorHeath Stewart27-May-04 4:56 
GeneralRe: Remoting Help! Please help urgently! Pin
hprahul27-May-04 14:41
hprahul27-May-04 14:41 
GeneralRe: Remoting Help! Please help urgently! Pin
Aaron Eldreth27-May-04 15:50
Aaron Eldreth27-May-04 15:50 
GeneralRe: Remoting Help! Please help urgently! Pin
hprahul27-May-04 20:25
hprahul27-May-04 20:25 
GeneralRe: Remoting Help! Please help urgently! Pin
Heath Stewart30-May-04 5:59
protectorHeath Stewart30-May-04 5:59 
GeneralRe: Remoting Help! Please help urgently! Pin
hprahul30-May-04 13:57
hprahul30-May-04 13:57 
GeneralRe: Remoting Help! Please help urgently! Pin
Heath Stewart1-Jun-04 6:11
protectorHeath Stewart1-Jun-04 6:11 
QuestionHow to log files downloaded Pin
Stuggo26-May-04 21:56
Stuggo26-May-04 21:56 
AnswerRe: How to log files downloaded Pin
Dave Kreskowiak27-May-04 4:19
mveDave Kreskowiak27-May-04 4:19 
AnswerRe: How to log files downloaded Pin
Heath Stewart27-May-04 4:52
protectorHeath Stewart27-May-04 4:52 
AnswerRe: How to log files downloaded Pin
Dave Kreskowiak27-May-04 5:30
mveDave Kreskowiak27-May-04 5:30 
GeneralABOUT CONTROL Listview Pin
Member 103377126-May-04 16:44
Member 103377126-May-04 16:44 
GeneralRe: ABOUT CONTROL Listview Pin
sreejith ss nair26-May-04 21:34
sreejith ss nair26-May-04 21:34 
GeneralRe: ABOUT CONTROL Listview Pin
Dave Kreskowiak27-May-04 3:44
mveDave Kreskowiak27-May-04 3:44 
GeneralDynamic Properties Pin
Steve Schaneville26-May-04 15:10
professionalSteve Schaneville26-May-04 15:10 
GeneralRe: Dynamic Properties Pin
Nick Parker26-May-04 15:52
protectorNick Parker26-May-04 15:52 

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.