In an aspx page I get the Windows username with the function Request.LogonUserIdentity.Name. This function returns a string in the format \"domain\\user\".
Request.LogonUserIdentity.Name
An alternative way of doing the same thing as the other answers:
var usernameWithoutDomain = Path.GetFileName(@"somedomain\someusername")
It is just unsafe as not checking for the @ variant of usernames.