Stamp: Double;
Stamp: System.Double;
The Stamp property returns date and time of the entry into the repository.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
AL: IAuditLog;
ALogon: IAuditLogons;
d, d1: DateTime;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Open access protocol
Al := MS.OpenAuditLog;
ALogon := AL.OpenLogons(False);
// Display to console information about current repository sessions
While Not ALogon.Eof Do
Debug.Write("Session: " + ALogon.Session.ToString + " | ");
d := DateTime.FromDouble(ALogon.Stamp);
d1 := DateTime.FromDouble(ALogon.StampOut);
Debug.WriteLine(d.ToString + "-" + d1.ToString);
ALogon.Next;
End While;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
AL: IAuditLog;
ALogon: IAuditLogons;
d, d1: DateTime;
Lic: Object;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Open access protocol
Al := MS.OpenAuditLog();
ALogon := AL.OpenLogons(False);
// Display to console information about current repository sessions
While Not ALogon.Eof() Do
System.Diagnostics.Debug.Write("Session: " + ALogon.Session.ToString() + " | ");
d := DateTime.FromOADate(ALogon.Stamp);
d1 := DateTime.FromOADate(ALogon.StampOut);
System.Diagnostics.Debug.WriteLine(d.ToString() + "-" + d1.ToString());
ALogon.Next();
End While;
// Check in license
Lic := Null;
End Sub;
After executing the example the information about the sessions with the current repository is displayed in the development environment console. A number of the session and start and finish dates of the session are also displayed.
See also: