FormsAuthenticationUser(String, String) 构造函数

定义

使用传递的参数初始化 FormsAuthenticationUser 类的新实例。

public:
 FormsAuthenticationUser(System::String ^ name, System::String ^ password);
public FormsAuthenticationUser (string name, string password);
new System.Web.Configuration.FormsAuthenticationUser : string * string -> System.Web.Configuration.FormsAuthenticationUser
Public Sub New (name As String, password As String)

参数

name
String

用户名。

password
String

用户密码。

示例

下面的代码示例演示如何创建 FormsAuthenticationUser 对象。


// Define the user name.
string name = "userName";
// Define the encrypted password.
string password = 
    "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";

// Create a new FormsAuthenticationUser object.
FormsAuthenticationUser newformsAuthenticationUser = 
    new FormsAuthenticationUser(name, password);
' Define the user name.
Dim name As String = "userName"
' Define the encrypted password.
  Dim password As String = _
  "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"

' Create a new FormsAuthenticationUser object.
  Dim newformsAuthenticationUser _
  As New FormsAuthenticationUser(name, password)

注解

此构造函数使用传递的参数创建 FormsAuthenticationUser 对象。

适用于