IStations.FindByName

Syntax

FindByName(Name: String): IStation;

Parameters

Name is a workstation name.

Description

The FindByName method returns a workstation from the collection by the specified name.

Comments

The method returns Null if the workstation with the specified name is not present in the local network.

Example

Executing the example requires a form, a button named Button1 on this form.

Sub Button1OnClick(Sender: Object; Args: IEventArgs);

Var

MB: IMetabase;

Sec: IMetabaseSecurity;

m_User: IMetabaseUser;

St: IStations;

s: String;

Begin

MB := MetabaseClass.Active;

Sec := MB.Security;

m_User := Sec.ResolveName("ADMIN") As IMetabaseUser;

St := m_User.Stations;

If St.FindByName("1C") <> Null Then

s := "Workstation was found";

Else

s := "Workstation was not found";

End If;

End Sub Button1OnClick;

On clicking the button, the workstation with the 1C name is searched in the ADMIN user collection, the result is saved in the "s" variable.

See also:

IStations

IDomainStations