Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upper case from System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()?

Tags:

c#

I hope this isn't oo trivial question, but when I call System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString() I'm getting back a lower case user ID, but other dev's are getting an upper case user ID. How can I force ystem.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString() to return an upper case string?

like image 652
chris Avatar asked Dec 06 '25 04:12

chris


2 Answers

Try

System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString().ToUpper()
like image 100
citronas Avatar answered Dec 08 '25 17:12

citronas


UPDATE!! I still have not completely answered my question, but I have a clue. When System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString() is called from my ASP.Net app when running within IIS I get a User ID with all caps. When I call this line from my asp.net app from within the vs.net web server my ID is in lower case.

Thanks for the response with the ToUpper() code, but I checked the production code and thatis not used.

like image 41
chris Avatar answered Dec 08 '25 17:12

chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!