共用方式為


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 物件。

適用於