Click here to Skip to main content
15,885,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: Remove a special character from a file and save in same file. Pin
harishusharma29-May-09 1:24
harishusharma29-May-09 1:24 
AnswerRe: Remove a special character from a file and save in same file. Pin
Nagy Vilmos29-May-09 1:12
professionalNagy Vilmos29-May-09 1:12 
GeneralRe: Remove a special character from a file and save in same file. Pin
harishusharma29-May-09 1:31
harishusharma29-May-09 1:31 
GeneralRe: Remove a special character from a file and save in same file. Pin
Nagy Vilmos29-May-09 1:43
professionalNagy Vilmos29-May-09 1:43 
AnswerRe: Remove a special character from a file and save in same file. Pin
Hoorfar29-May-09 22:15
Hoorfar29-May-09 22:15 
QuestionRe: Remove a special character from a file and save in same file. Pin
harishusharma9-Jul-09 6:22
harishusharma9-Jul-09 6:22 
Questionlogged in username in windows service Pin
P. S. Pundeer29-May-09 0:29
P. S. Pundeer29-May-09 0:29 
AnswerRe: logged in username in windows service Pin
Simon P Stevens29-May-09 0:46
Simon P Stevens29-May-09 0:46 
System.Security.Principal.WindowsIdentity.GetCurrent().Name will get you the user that the service is running as, but services generally run under special user accounts like "Local Service". Services also start before the user logs on so you can't just set it to run under the currently logged on user, because there might not be one.

Services aren't really meant to be tied to the logged on user. What would happen if you had two users logged on at the same time (which can happen). Perhaps you should consider making your app a normal client based app (but with no GUI) and stick a short cut to it in the start up menu.

You should also probably be using windows authentication instead of getting the user name.

Simon

Questionenterprise libeary query Pin
sheemap29-May-09 0:22
sheemap29-May-09 0:22 
AnswerRe: enterprise libeary query Pin
Nagy Vilmos29-May-09 0:39
professionalNagy Vilmos29-May-09 0:39 
QuestionMessage Handling...... Pin
vishal moharikar29-May-09 0:11
vishal moharikar29-May-09 0:11 
AnswerRe: Message Handling...... Pin
AhsanS29-May-09 0:14
AhsanS29-May-09 0:14 
GeneralRe: Message Handling...... Pin
vishal moharikar29-May-09 0:21
vishal moharikar29-May-09 0:21 
GeneralRe: Message Handling...... Pin
0x3c029-May-09 0:23
0x3c029-May-09 0:23 
AnswerRe: Message Handling...... Pin
0x3c029-May-09 0:26
0x3c029-May-09 0:26 
AnswerRe: Message Handling...... Pin
Rob Philpott29-May-09 0:30
Rob Philpott29-May-09 0:30 
GeneralRe: Message Handling...... Pin
Rob Philpott29-May-09 0:35
Rob Philpott29-May-09 0:35 
GeneralRe: Message Handling...... Pin
vishal moharikar29-May-09 0:48
vishal moharikar29-May-09 0:48 
GeneralRe: Message Handling...... Pin
Rajesh R Subramanian29-May-09 1:27
professionalRajesh R Subramanian29-May-09 1:27 
GeneralRe: Message Handling...... Pin
Rob Philpott29-May-09 3:14
Rob Philpott29-May-09 3:14 
AnswerRe: Message Handling...... Pin
mark_ian1-Jun-09 4:57
mark_ian1-Jun-09 4:57 
QuestionCombobox Pin
yesu prakash29-May-09 0:03
yesu prakash29-May-09 0:03 
AnswerRe: Combobox Pin
stancrm29-May-09 0:06
stancrm29-May-09 0:06 
AnswerRe: Combobox Pin
Ravi Mori29-May-09 0:08
Ravi Mori29-May-09 0:08 
AnswerRe: Combobox Pin
AhsanS29-May-09 0:15
AhsanS29-May-09 0:15 

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.