ASP.NET Core Web(MVC) 登入

采用 ASP.NET Core Web(MVC) 验证类型的个别帐户(【程序开发笔记】ASP.NET Core Web(MVC) 验证类型的抉择)

  1. 确定链接字符串正确(链接字符串有问题的请至“【程式开发笔记】SQL Server Connection String Generator”)
  2. 数据库内目前没有其他数据表
    https://ithelp.ithome.com.tw/upload/images/20230722/20113319q2w19ZyBq3.png
  3. Run 项目(使用IIS Express) > 登录
    https://ithelp.ithome.com.tw/upload/images/20230722/20113319hpzxOFPeKu.png
  4. Click “Log in”
    https://ithelp.ithome.com.tw/upload/images/20230722/201133193FHh0Bo4WS.png
  5. 因为是第一次使用,没有数据表无法登入,这里Click “Apply Migrations”产生数据表
    https://ithelp.ithome.com.tw/upload/images/20230722/20113319Ft5AdfgQzd.png
  6. 等待一段时间后会提示“Try refreshing the page”,再去数据库看,会多出七张数据表
    https://ithelp.ithome.com.tw/upload/images/20230722/201133197q8xs16meq.png
  7. 重整后再次登入,因为没有注册账号一样无法登入
    https://ithelp.ithome.com.tw/upload/images/20230722/20113319E2t8bTokgX.png
  8. 注册账号密码
    https://ithelp.ithome.com.tw/upload/images/20230722/201133192vwlrHPc03.png
  9. 注册后这里提示需到Email收取信件验证,但是是第一次不会有发信人…
    https://ithelp.ithome.com.tw/upload/images/20230722/20113319L30jDkqfaF.png
  10. 直接打开AspNetUsers资料表,在EmailConfirmed,把刚刚注册的改成True
    https://ithelp.ithome.com.tw/upload/images/20230722/20113319rZMU18Edcy.png
  11. 再回到登录画面,输入账号密码,成功后右上方会提示 “Hello [您注册的帐号]!”
    https://ithelp.ithome.com.tw/upload/images/20230722/201133199AZA4dQtbh.png
(0)
游研哥游研哥

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注