FindByName(Name: String): IDomain;
Name is a domain name.
The FindByName method returns a domain from the collection by the specified name.
The method returns Null if the local net does not contain a domain with the specified name.
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;
Dm: IDomains;
Begin
MB := MetabaseClass.Active;
Sec := MB.Security;
m_User := Sec.ResolveName("ADMIN") As IMetabaseUser;
St := m_User.Stations;
Dm := St.Domains;
If Dm.FindByName("PROGNOZ") <> Null Then
s := "Domain is found";
Else
s := "Domain is not found";
End If;
End Sub Button1OnClick;
Pressing the button will activate searching of a domain named PROGNOZ in the user ADMIN collection, the s variable will store the search result.
See also: