ASP.NET MVC Web Application內建會員系統
1.建立專案時選擇ASP.NET Web Application(.NET Framework) Visual C#
2.範本選擇MVC,Authentication認證選擇Individual User Accounts個別使用者帳戶

3.建置並開始偵錯,首頁右上角就會有[註冊]與[登入]兩個功能,點選註冊
填入email做為帳號,輸入密碼,點擊[註冊]按鈕就會成功註冊成會員
4.會員資料預設存放在Visual Studio 2017內建的SQL Server Express LocalDB(輕量版SQL Express)
SQL Server Express LocalDB is a lightweight version of Express that has all of its programmability features, runs in user mode and has a fast, zero-configuration installation and a short list of prerequisites
在AspNetUsers資料表右鍵,選擇檢視資料,即可看到剛新增的會員資料
資料庫檔案預設位置
C:\Users\UserName\source\repos\WebApp1\WebApp1\App_Data\aspnet-WebApp1-20190706124408.mdf
SQL Express LocalDb Instance位置
Reference:
Create a secure ASP.NET MVC 5 web app with log in, email confirmation and password reset (C#)
沒有留言:
張貼留言