Link to home
Start Free TrialLog in
Avatar of r3nder
r3nderFlag for United States of America

asked on

Split and get rid of

I captured the windows Identity and need to take off the domain name before I write it to the database.
The results of the following code are DOMAIN\r3nder - I need it to be just r3nder
I am sure its easy I just cant find the way to Split it

WindowsIdentity currIdentity = WindowsIdentity.GetCurrent();
string NtAccountName = currIdentity.Name;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mquiroz
mquiroz

or something like:

NtAccountName.Split('\\')[1]
Avatar of r3nder

ASKER

you are the bomb Kaufmed = as usual!!!
Glad to help...   as usual   :D