Redigera

Dela via


NTAccount Constructors

Definition

Initializes a new instance of the NTAccount class.

Overloads

NTAccount(String)

Initializes a new instance of the NTAccount class by using the specified name.

NTAccount(String, String)

Initializes a new instance of the NTAccount class by using the specified domain name and account name.

NTAccount(String)

Initializes a new instance of the NTAccount class by using the specified name.

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)

Parameters

name
String

The name used to create the NTAccount object. This parameter cannot be null or an empty string.

Exceptions

name is null.

name is an empty string.

-or-

name is too long.

Remarks

The specified name is not required to correspond to an existing account or group, but translation into other IdentityReference-derived types will not be possible unless the account or group does exist.

Applies to

NTAccount(String, String)

Initializes a new instance of the NTAccount class by using the specified domain name and account name.

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)

Parameters

domainName
String

The name of the domain. This parameter can be null or an empty string. Domain names that are null values are treated like an empty string.

accountName
String

The name of the account. This parameter cannot be null or an empty string.

Exceptions

accountName is null.

accountName is an empty string.

-or-

accountName is too long.

-or-

domainName is too long.

Remarks

The specified domain and account names are not required to correspond to an existing account or group, but translation into other IdentityReference-derived types will not be possible unless the account or group does exist.

Applies to