wrote:
from the above path i want to know how to get this following value
(S-1-5-21-2000478354-1214440339-682003330)
This value is called SID. SID is a unique user identifier. This is so windows still knows who you are even if you change your username. :)
To get the SID of the currently logged user you could try:
string username = String.Format(@"{0}\{1}", Environment.UserDomainName, Environment.UserName);
System.Security.Principal.WindowsIdentity id = new System.Security.Principal.WindowsIdentity(username);
string sid = id.User.AccountDomainSid.ToString();
or:
System.Security.Principal.WindowsIdentity id = System.Security.Principal.WindowsIdentity.GetCurrent();
string sid = id.User.AccountDomainSid.ToString();
I hope this helps. :)
Regards