home *** CD-ROM | disk | FTP | other *** search
- unit EventLogProps;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ComCtrls, StdCtrls;
-
- type
- TpropEventLog = class(TFrame)
- PageControl1: TPageControl;
- tsEvent: TTabSheet;
- lType: TLabel;
- lTime: TLabel;
- lDate: TLabel;
- stType: TStaticText;
- stTime: TStaticText;
- stDate: TStaticText;
- lComputer: TLabel;
- lUser: TLabel;
- stComputer: TStaticText;
- stUser: TStaticText;
- lID: TLabel;
- lCatg: TLabel;
- lSource: TLabel;
- stID: TStaticText;
- stCatg: TStaticText;
- stSource: TStaticText;
- mDesc: TMemo;
- lDesc: TLabel;
- mData: TMemo;
- lData: TLabel;
- private
- FEvent: TObject;
- public
- property Event: TObject read FEvent write FEvent;
- procedure Refresh;
- end;
-
- implementation
-
- uses MiTeC_EventLogNT;
-
- {$R *.DFM}
-
- { TpropEventLog }
-
- procedure TpropEventLog.Refresh;
- var
- sl1,sl2: TStringList;
- i,j,k: integer;
- s1,s2: string;
- begin
- with PLogRecord(Event)^ do begin
- stDate.Caption:=DateToStr(Datetime);
- stTime.Caption:=TimeToStr(Datetime);
- stType.Caption:=EventTypes[EventType];
- if Username='' then
- stUser.Caption:='N/A'
- else
- stUser.Caption:=Username+'\'+Domain;
- stComputer.Caption:=Computer;
- stSource.Caption:=Source;
- if Category='' then
- stCatg.Caption:='None'
- else
- stCatg.Caption:=Category;
- stID.Caption:=Format('%d',[EventID]);
- mDesc.Text:=Description;
- sl1:=TStringList.Create;
- sl1.CommaText:=BinaryData;
- sl2:=TStringList.Create;
- sl2.CommaText:=CharData;
- j:=0;
- k:=0;
- s1:='';
- s2:='';
- mData.Lines.Clear;
- for i:=0 to sl1.Count-1 do begin
- s1:=s1+' '+sl1[i];
- s2:=s2+sl2[i];
- Inc(j);
- if j=8 then begin
- mData.Lines.Add(IntToHex(k,4)+':'+s1+stringofchar(' ',3)+s2);
- s1:='';
- s2:='';
- j:=0;
- Inc(k,8);
- end;
- end;
- if (j>0) then
- mData.Lines.Add(IntToHex(k,4)+':'+s1+stringofchar(' ',3)+s2);
- sl1.Free;
- sl2.Free;
- end;
- end;
-
- end.
-