語言

NTAccount 建構函式

定義

初始化 NTAccount 類別的新執行個體。

多載

名稱 Description
NTAccount(String)

使用指定名稱初始化類別的新實例 NTAccount 。

NTAccount(String, String)

透過使用指定的網域名稱和帳號名稱初始化該 NTAccount 類別的新實例。

NTAccount(String)

使用指定名稱初始化類別的新實例 NTAccount 。

public:
 NTAccount(System::String ^ name);
public NTAccount(string name);
new System.Security.Principal.NTAccount : string -> System.Security.Principal.NTAccount
Public Sub New (name As String)

參數

name
String

這個名稱是用來創造這個 NTAccount 物件的。 這個參數不能是 null 空字串。

例外狀況

name 是 null。

name 是空字串。

-或-

name 太長了。

備註

指定名稱不必對應現有帳號或群組,但除非帳號或群組存在,否則無法轉換成其他 IdentityReference-衍生類型。

適用於

NTAccount(String, String)

透過使用指定的網域名稱和帳號名稱初始化該 NTAccount 類別的新實例。

public:
 NTAccount(System::String ^ domainName, System::String ^ accountName);
public NTAccount(string domainName, string accountName);
new System.Security.Principal.NTAccount : string * string -> System.Security.Principal.NTAccount
Public Sub New (domainName As String, accountName As String)

參數

domainName
String

功能變數名稱。 這個參數可以是 null 或 空字串。 空值的網域名稱會被視為空字串。

accountName
String

帳戶名稱。 這個參數不能是 null 空字串。

例外狀況

accountName 是 null。

accountName 是空字串。

-或-

accountName 太長了。

-或-

domainName 太長了。

備註

指定的網域名稱與帳號名稱不必對應現有帳號或群組,但除非帳號或群組存在,否則無法轉換成其他 IdentityReference-衍生類型。

適用於