gpt4 book ai didi

ASP.NET - 使用 web.config 文件中的凭据进行登录控制

转载 作者:行者123 更新时间:2023-12-01 02:59:05 25 4
gpt4 key购买 nike

我一直在尝试创建一个快速而肮脏的应用程序。此应用程序需要支持用户身份验证。为了实现这一点,我想我可以依靠内置的登录控件并像这样利用 web.config 的凭据功能:

<authentication mode="Forms">
<forms defaultUrl="/authenticated/menu.aspx" loginUrl="Default.aspx">
<credentials passwordFormat="Clear">
<user name="user1" password="p@ssw0rd" />
</credentials>
</forms>
</authentication>

但是,登录控件似乎需要成员(member)提供程序。我有以下两个问题:
  • 是否存在与 web.config 配合使用的成员资格提供程序?如果有,在哪里?我一直找不到?
  • 是否可以使用 web.config 中的凭据登录到 Web 应用程序?

  • 谢谢!

    最佳答案

    Web.config 没有内置的成员(member)提供程序.您可以使用 FormsAuthentication.Authenticate 手动验证凭据。方法。

    关于ASP.NET - 使用 web.config 文件中的凭据进行登录控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1544348/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com