windows service username
-
hi all, normally in win app. or web app. I can take windows log on username with this code "System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();" but with windows service I can't do this, it takes like this: "NT AUTHORITY\SYSTEM" Howcan I do this with windows service?? thanks..
-
hi all, normally in win app. or web app. I can take windows log on username with this code "System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();" but with windows service I can't do this, it takes like this: "NT AUTHORITY\SYSTEM" Howcan I do this with windows service?? thanks..
-
hi all, normally in win app. or web app. I can take windows log on username with this code "System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();" but with windows service I can't do this, it takes like this: "NT AUTHORITY\SYSTEM" Howcan I do this with windows service?? thanks..
Go to your control panel-Admin Tools-Services and right click on the service, select properties -Log On tab ... have fun. BTW,
System.Security.Principal.WindowsIdentity.GetCurrent().Name
is a string. If you call ToString on a string you look foolish. It is my personal crusade to get .NET developers to understand the concept of type.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
hi all, normally in win app. or web app. I can take windows log on username with this code "System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();" but with windows service I can't do this, it takes like this: "NT AUTHORITY\SYSTEM" Howcan I do this with windows service?? thanks..
Dumb answer of the day. The service is running on a SERVER, the user name is what you started the service with. You nee dto get the username from the CLIENT and pass it to the service to record with the data.
Never underestimate the power of human stupidity RAH