IConnectedUsersInfoEx.Disconnect

Syntax

Disonnect(Value: IConnectedUserInfoEx);

Description

The Disconnect method disconnects an active user from the repository.

Example

Executing the example requires the Button component with the Button1 identifier.

Add a link to the Metabase system assembly.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    User: IConnectedUserInfoEx;
    Users: IConnectedUsersInfoEx;
Begin
    MB := MetabaseClass.Active;
    Users := MB.GetConnectedUsersEx;
    
If Users.Count < 5 Then
            Debug.Write(
"Number of connected users is less than 5");
    
Else
        User := Users.Item(
5);
        Users.Disconnect(User);
    
End If;
End Sub Button1OnClick;

After executing the example clicking the button checks the number of active repository users. If the number of active users is less than five, the console displays the message: Number of connected users is less than 5". If the number of connected users is greater than five, the user with the 5 identifier will be disconnected.

See also:

IConnectedUsersInfoEx