Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

ASP.Net - Copying a user profile

written by Mark Rowlinson - Last updated Jul 2008

The following code will copy the profile from one user "CopyFrom" to another user "CopyTo". This could be useful in providing a default profile on login.

 
Dim pFrom, pTo As ProfileCommon 
pFrom = Profile.GetProfile("CopyFrom") 
pTo = Profile.GetProfile("CopyTo") 
Dim sp As System.Configuration.SettingsProperty 
For Each sp In ProfileCommon.Properties 
    pTo.Item(sp.Name) = pFrom.Item(sp.Name) 
Next 
pTo.Save()