Profile configuration in Web. config
< Profile > // Define the configuration (profile)
< Properties >
< Add Name = "Name" Allowanonymous = "True" />
</ Properties >
</ Profile >
Manage the user's storage configuration information and pass in the username parameter so that all profiles can be managed
Use System. Web. profile. profilebase to get the specified user name and create an instance of the configuration file.
' The followingCodeExample: Create an instance of the custom configuration file object, set properties, and save the configuration file to the data source
Private Sub Saveuserinfo () Sub Saveuserinfo ( Byval Username As String )
DimObjprofileAsAspnetprofile. profilebase
Objprofile=System. Web. profile. profilebase. Create (username)
Objprofile. Item ("Name")=Txtbname. Text
Objprofile. Save ()
End sub
'The following code example creates an instance of a custom configuration file object and obtains attributes.
Private SubGetuserinfo ()SubGetuserinfo (ByvalUsernameAs String)
DimObjprofileAsAspnetprofile. profilebase
Objprofile=System. Web. profile. profilebase. Create (username,True)
Txtbname. Text=Objprofile. Item ("Name")
End sub