I am trying this:
typeof(FormsIdentity)
.GetField("Name", BindingFlags.Instance | BindingFlags.NonPublic)
.SetValue(HttpContext.Current.User.Identity, newUsername);
but typeof(FormsIdentity).GetField("Name", BindingFlags.Instance | BindingFlags.NonPublic)
returns null. What I am trying to do is allow a user to change their username.
Aucun commentaire:
Enregistrer un commentaire