Use the code to below to strip out the DOMAIN\ portion from a SharePoint Active Directory user account:
string domainUser = Regex.Replace("domain\\user",".*\\\\(.*)", "$1",RegexOptions.None);
OR
string shortName = System.IO.Path.GetFileNameWithoutExtension(ResourceLoginName);
No comments:
Post a Comment