Connectivity Software User's Guide and Reference
Create Method (INameAndPasswordUserManager)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security.User Namespace > INameAndPasswordUserManager Interface : Create Method
The username for the new user.

The value of this parameter cannot be null (Nothing in Visual Basic).

The password for the new user.

The value of this parameter cannot be null (Nothing in Visual Basic).

Whether the new user should be enabled.
Creates a new user with the specified username, password, and enabled status.
Syntax
'Declaration
 
<JetBrains.Annotations.CanBeNullAttribute()>
Function Create( _
   ByVal userName As String, _
   ByVal password As String, _
   ByVal enabled As Boolean _
) As String
'Usage
 
Dim instance As INameAndPasswordUserManager
Dim userName As String
Dim password As String
Dim enabled As Boolean
Dim value As String
 
value = instance.Create(userName, password, enabled)
[JetBrains.Annotations.CanBeNull()]
string Create( 
   string userName,
   string password,
   bool enabled
)
[JetBrains.Annotations.CanBeNull()]
String^ Create( 
   String^ userName,
   String^ password,
   bool enabled
) 

Parameters

userName
The username for the new user.

The value of this parameter cannot be null (Nothing in Visual Basic).

password
The password for the new user.

The value of this parameter cannot be null (Nothing in Visual Basic).

enabled
Whether the new user should be enabled.

Return Value

The security ID of the created user, or null if the operation failed.

This method can return null (Nothing in Visual Basic).

Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

An invoked method is not supported at all, or is not supported with the parameters used to create the object.
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also