The previous section introduced the login control and some related controls such as loginname,
However, all those things are outer things,
The membership and role APIs are actually completed,
Membership is used to create and manage qualified users,
Role is used to create and manage roles (user groups ),
In fact, there are many classes related to membership,
But the common one isMembership static class, membershipuser,
Membershipcreatestatus, membershipusercollection,
Membership and membershipuser are the most widely used categories,
Membership manages and creates the entire user group,
However, membershipuser performs operations on specific users,
Membershipcreatestatus is the status information returned when a new member is created using membership,
While membershipcollection is a collection of membershipuser,
The following blog posts mainly introduce membership, membershipuser,
Membershipcreatestatus,
The two data tables aspnet_users and aspnet_membership are operated,
Since data tables are involved, you must register a website database when using membership,
In this case, you should read the previous blog, which specifically introduces aspnet_regsql,
After the database is registered, as we know, 11 data tables will be created in the specified database,
Membership, role, profile, and webparts are involved,
For User Registration and Management, two data tables are involved,
Aspnet_users and aspnet_membership data tables,
That is, the data tables that use membership and other related classes to operate are the above two tables,
At the beginning, I will not introduce the membership and membershipuser classes,
Is it because of the class? It's all well written, as long as the call is OK,
Some of these mechanisms must be clarified by yourself,
So in this blog post, I will first introduce the most basic provider
Basically, it is the settings of the membership provider and some basic configurations,
Basically, the default configuration of the provider is rigorous,
(The password must be more than 7 characters long and contain non-alphanumeric characters)
You can directly use these default configurations. in IIS, the default configuration provider is
Of course, the defaultProgramFor example, you must register a secret with at least seven characters,
If you need to meet me, I will register your website. I have a rare password,
So if you want to change these configurations, you can also, because you can customize the provider
Your system is the flagship edition of win7, And the IIS version is 7.5,
You can see how to change these settings,
Deploy your web application on IIS first, and then follow the steps below,
There are a lot of settings, these settings are used to configure the provider,
After configuration, your program automatically uses these settings during running,
For example, the default password must be 7 characters long and can be changed to 4 characters,
In this way, you can enter a 4-character password to register a user.
(By default, there must be 7; otherwise, registration fails ),
There are many attributes that can be set. You can just cut a graph,
The content is clearly written. You will understand it as long as you read it,
However, when you change the provider in IIS,
It will be fed back to Web. config,
For example, when I set mymembershipprovider as the provider of the application,
The following tag will be added to Web. config:
From here, you will know what the provider is,
In fact, after configuration in Web. config, you need to use it on every membership,
You can also modify these attributes in code-behind,
You can use membership to directly modify,
You can also use membership. provider to obtain the settings of the provider (membershiprovider,
If it is not clear, you can write it directly.Code, Directly use membership. To bring out smart tags,
This makes it clear.
2010-2-06