【delphi开源代码栏目提醒】:网学会员delphi开源代码为您提供frm_listPort.pas参考,解决您在frm_listPort.pas学习中工作中的难题,参考学习。
unit frm_listPort;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Registry, StdCtrls, XPMan,shellAPI;
type
TFrmListPort = class(TForm)
GBxListPort: TGroupBox;
MmListPort: TMemo;
BtnPort: TButton;
BtnClose: TButton;
XPManifest1: TXPManifest;
procedure BtnCloseClick(Sender: TObject);
procedure BtnPortClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmListPort: TFrmListPort;
implementation
{$R *.dfm}
procedure TFrmListPort.BtnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TFrmListPort.BtnPortClick(Sender: TObject);
begin
winexec('Command.com /c netstat -a -n > c:\port.txt',sw_hide);
Sleep(2000);
if fileExists('c:\port.txt') then
MmListPort.Lines.LoadFromFile('c:\port.txt');
end;
end.