ShowLog.pas
资源名称:计算机远程监控.rar [点击查看]
上传用户:rickyhu
上传日期:2007-05-27
资源大小:842k
文件大小:2k
源码类别:
控制台编程
开发平台:
Delphi
- ////////////////////////////////////////////////////////////////////////////////
- //
- // 2004 (C) Copyrights Reserved
- // Author:Aureala
- //
- ////////////////////////////////////////////////////////////////////////////////
- unit ShowLog;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, ComCtrls, StdCtrls, UtilTools;
- type
- TShowLogForm = class(TForm)
- Panel1: TPanel;
- LVLog: TListView;
- Panel2: TPanel;
- BtnSelectLog: TButton;
- OpenDialog: TOpenDialog;
- Label16: TLabel;
- CBClient: TComboBox;
- Label7: TLabel;
- CBViewItem: TComboBox;
- BtnView: TButton;
- procedure BtnSelectLogClick(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure CBClientChange(Sender: TObject);
- procedure CBViewItemChange(Sender: TObject);
- procedure BtnViewClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- ShowLogForm: TShowLogForm;
- implementation
- {$R *.dfm}
- procedure TShowLogForm.BtnSelectLogClick(Sender: TObject);
- begin
- OpenDialog.Title:='查看计算机监视日志记录';
- OpenDialog.Filter:='日志记录|*.rec';
- OpenDialog.InitialDir:=ExtractFilePath(ParamStr(0)+'log');
- OpenDialog.Execute;
- if(OpenDialog.FileName<>'') then
- begin
- BtnView.Click;
- end;
- end;
- procedure TShowLogForm.FormClose(Sender: TObject;
- var Action: TCloseAction);
- begin
- Close;
- Release;
- end;
- procedure TShowLogForm.CBClientChange(Sender: TObject);
- begin
- BtnView.Click;
- end;
- procedure TShowLogForm.CBViewItemChange(Sender: TObject);
- begin
- BtnView.Click;
- end;
- procedure TShowLogForm.BtnViewClick(Sender: TObject);
- begin
- try
- LoadLog(OpenDialog.FileName,CBClient.Text,CBViewItem.ItemIndex,LVLog);
- except
- ;
- end;
- if(LVLog.Items.Count<=0) then
- ShowMessage('没有你要查看的日志记录!');
- end;
- procedure TShowLogForm.FormCreate(Sender: TObject);
- begin
- UpdateClient(CBClient);
- CBClient.Items.Strings[0]:='全部';
- CBClient.ItemIndex:=0;
- end;
- end.