Where is the login information (username, password) actually stored by using the default template from ASP.NET MVC application in VS2010? I mean, is it physically registered in a database, file or something else?
问题:
回答1:
Upon registering the first user a database named ASPNETDB.MDF under the application’s App_Data directory is created. This information was supplied by default in the root web.config file.
回答2:
There is no default login. There is not even a database created when you start a new project. You need to register a new user by clicking on the Register
link on the login page. When you register a new user you will be prompted to specify the username and password and a database file will be created in the App_Data
folder. Now you can go ahead and login with the account you have just created. And by the way the same stands true for ASP.NET MVC 1.0 and 2.0 project templates.
回答3:
If you can't see the database under App_data, try clicking "Show all Files" which is one of the icons at the top of the solutions explorer. Then the database will show under App_data as something like ASPNETD8.MDF.