FormsAuthentication.Authenticate(String, String) 方法

定义

注意

The recommended alternative is to use the Membership APIs, such as Membership.ValidateUser. For more information, see http://go.microsoft.com/fwlink/?LinkId=252463.

根据存储在应用程序的配置文件中的凭据验证用户名和密码。

public:
 static bool Authenticate(System::String ^ name, System::String ^ password);
public static bool Authenticate(string name, string password);
[System.Obsolete("The recommended alternative is to use the Membership APIs, such as Membership.ValidateUser. For more information, see http://go.microsoft.com/fwlink/?LinkId=252463.")]
public static bool Authenticate(string name, string password);
static member Authenticate : string * string -> bool
[<System.Obsolete("The recommended alternative is to use the Membership APIs, such as Membership.ValidateUser. For more information, see http://go.microsoft.com/fwlink/?LinkId=252463.")>]
static member Authenticate : string * string -> bool
Public Shared Function Authenticate (name As String, password As String) As Boolean

参数

name
String

用户名。

password
String

用户的密码。

返回

true 如果用户名和密码有效,则为否则,为 false.

属性

注解

此方法已过时。 建议的替代方法是使用成员资格 API,例如 Membership.ValidateUser(String, String)。 有关详细信息,请参阅 使用成员身份管理用户

适用于