Here is what I do (DNN 4.5.1):
DotNetNuke.Entities.Users.UserInfo user_ = new DotNetNuke.Entities.Users.UserInfo();
user_.PortalID = PortalId;
user_.FirstName = txtFName_.Text;
user_.Profile.FirstName = txtFName_.Text;
user_.LastName = txtLName_.Text;
user_.Profile.LastName = txtLName_.Text;
user_.DisplayName = user_.FirstName + ' ' + user_.LastName;
user_.Profile.Street = ctlAddress_.Street;
user_.Profile.Unit = ctlAddress_.Unit;
user_.Profile.City = ctlAddress_.City;
user_.Profile.Region = ctlAddress_.Region;
user_.Profile.PostalCode = ctlAddress_.Postal;
user_.Profile.Telephone = ctlAddress_.Telephone;
user_.Email = txtEmail_.Text;
user_.Username = txtUsername.Text;
user_.Membership.Email = txtEmail_.Text;
user_.Membership.Username = txtUsername.Text;
user_.Membership.Password = WebHelper.RandomPassword.Generate(8, 10); //This is our own routine to create random passwords
user_.Membership.Approved = false;
user_.AffiliateID = -1;
try
{
user_.UserID = Session["userId"] != null ? user_.UserID = int.Parse(Session["userId"].ToString()) : -1;
}
catch { }
if (user_.UserID > 0)
{
DotNetNuke.Entities.Users.UserController.UpdateUser(PortalId, user_);
}
else
{
UserCreateStatus createStatus = DotNetNuke.Entities.Users.UserController.CreateUser(ref user_);
}