terça-feira, 31 de maio de 2016

iMIS - C# - Creating an user credential



Here is a piece of code to create an user credential and update the Asp_membership table.


objContact.CreateUserSecurity("username01", "123456");
objContact.UserSecurity.ExpiresOn = DateTime.Parse("01/01/2050");
objContact.UserSecurity.Save();
objContact.Save();
//Don't forge to update the aspnet_membership table. - Otherwise the forget password doesn't work.

MembershipUser objMembership = Membership.GetUser(sEmail);
objMembership.Email = sEmail;
Membership.UpdateUser(objMembership);

Nenhum comentário:

Postar um comentário