Study membership Day 1

Source: Internet
Author: User
Tags connectionstrings

 

<Membership defaultprovider = " Remotesqlmembershipprovider " >

<Providers>

<Add name = " Remotesqlmembershipprovider " Type = " System. Web. Security. sqlmembershipprovider, system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a " Connectionstringname = " Remotesqlserver " Enablepasswordretrieval = " False " Enablepasswordreset = " True " Requiresquestionandanswer = " False " Applicationname = " / " Requiresuniqueemail = " False " Passwordformat = " Hashed " Maxinvalidpasswordattempts = " 5 " Minrequiredpasswordlength = " 7 " Minrequirednonalphanumericcharacters = " 1 " Passwordattemptwindow = " 10 " Passwordstrengthregularexpression = "" />

</Providers>

Today, I started to study membershp. I first looked at some information about menbershio. I was confused by many terms, but I also had my own understanding of menbership.
Is to make the login control provided by. net available.
I know what this is ~~~~
So I started setting.
I found it successfully. Aspnet_regsql Tool.
The path on the sub-host is c: \ windows \ Microsoft. NET \ framework \ v2.0.50727.
I don't know why others are using this path.% SystemRoot % \ Microsoft. NET \ framework \ v2.x \
And% SystemRoot %What is it?
I double-clickAspnet_regsqlYou have configured the database as required and found that there are some more data in the database. Maybe this is even better.
Then proceed to the next step.
"At this time, we needWeb. configChangeMembershipOfProvider"
The project I created does not haveWeb. configSo I added a new one.
I added <connectionstrings>
But I don't know what it is.Machine. config
Continue,
I copied and pasted the following words.

  < Membership Defaultprovider = "Remotesqlmembershipprovider" >

< Providers >

< Add Name = "Remotesqlmembershipprovider" Type = "System. Web. Security. sqlmembershipprovider, system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" Connectionstringname = "Remotesqlserver" Enablepasswordretrieval = "False" Enablepasswordreset = "True" Requiresquestionandanswer = "False" Applicationname = "/" Requiresuniqueemail = "False" Passwordformat = "Hashed" Maxinvalidpasswordattempts = "5" Minrequiredpasswordlength = "7" Minrequirednonalphanumericcharacters = "1" Passwordattemptwindow = "10" Passwordstrengthregularexpression = ""   />

</ Providers >

So my Web. config As follows: <? XML version = "1.0" encoding = "UTF-8" ?>
<! --  
Note: In addition to manually editing this file, you can also use
Web management tools to configure application settings. You can use
"Website"-> "ASP. NET configuration" option.
The complete list of settings and comments is displayed in
In machine. config. Comments, this file is usually located in
\ Windows \ Microsoft. NET \ framework \ v2.x \ config
-->
< Configuration Xmlns = "Http://schemas.microsoft.com/.NetConfiguration/v2.0" >
< Appsettings />
< Connectionstrings >
< Add Name = "Memconnectionstring1" Connectionstring = "Data Source =.; initial catalog = MEM; persist Security info = true; user id = sa; Password = hicc"
Providername = "System. Data. sqlclient"   />
</ Connectionstrings >

< Membership Defaultprovider = "Remotesqlmembershipprovider" >

< Providers >

< Add Name = "Remotesqlmembershipprovider" Type = "System. Web. Security. sqlmembershipprovider, system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" Connectionstringname = "Remotesqlserver" Enablepasswordretrieval = "False" Enablepasswordreset = "True" Requiresquestionandanswer = "False" Applicationname = "/" Requiresuniqueemail = "False" Passwordformat = "Hashed" Maxinvalidpasswordattempts = "5" Minrequiredpasswordlength = "7" Minrequirednonalphanumericcharacters = "1" Passwordattemptwindow = "10" Passwordstrengthregularexpression = ""   />

</ Providers >
</ Membership >




< Rolemanager Enabled = "True" >
< Providers >
< Remove Name = "Aspnetsqlroleprovider"   />
< Add Connectionstringname = "Memconnectionstring1" Applicationname = "/" Name = "Aspnetsqlroleprovider"
Type = "System. Web. Security. sqlroleprovider, system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"   />
</ Providers >
</ Rolemanager >

< System . Web >
<! --  
Set compilation DEBUG = "true" to insert the debugging symbol
Compiled pages. However, this
Performance is affected, so this value is only available during development.
Set to true.
-->
< Compilation Debug = "False"   />
<! --
In the <authentication> section, you can configure
Security Authentication mode,
To identify the user.
-->
< Authentication Mode = "Windows"   />
<! --
If an unprocessed error occurs during request execution,
You can configure the corresponding processing steps in the <mermerrors> section. Specifically,
This section allows developers to configure
HTML error page to be displayed
To replace the error stack trace.

<Customerrors mode = "remoteonly" defaultredirect = "genericerrorpage.htm">
<Error statuscode = "403" Redirect = "noaccess.htm"/>
<Error statuscode = "404" Redirect = "filenotfound.htm"/>
</Customerrors>
-->
</ System. Web >
</ Configuration >

You can choose a website on the page> ASP. NET configuration> Security:A problem may occur in the selected data storage zone because the server name or creden are invalid or the permissions are insufficient. It may also be caused by the absence of the role manager function. Click the following button to redirect to the page where you can select a new data storage area.

The following message may help diagnose the problem: Unrecognized configuration section membership. (E: \ sea \ mem \ WEB. config line 17)

What's wrong?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.