I\'m trying to find out current user name for my sharepoint application. There are more that one way how to do this. However the sharepoint way returns misleading value.
I think you might have include this code under SPSecurity.RunWithElevatedPriviliges. Check it out once. I am not sure though