NTAccount Constructor (String, String)

 

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

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

public NTAccount(
	string domainName,
	string accountName
)

Parameters

domainName
Type: System.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
Type: System.String

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

Exception Condition
ArgumentNullException

accountName is null.

ArgumentException

accountName is an empty string.

-or-

accountName is too long.

-or-

domainName is too long.

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.

.NET Framework
Available since 2.0
Return to top
Show: