【delphi开源代码栏目提醒】:网学会员为广大网友收集整理了,frm_TCPCheck.pas,希望对大家有所帮助!
unit frm_TCPCheck;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Winsock, StdCtrls, ExtCtrls, XPMan;
type
TFrmTCPIP = class(TForm)
RGPIsinstall: TRadioGroup;
BtnCheck: TButton;
BtnClose: TButton;
procedure BtnCheckClick(Sender: TObject);
procedure BtnCloseClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmTCPIP: TFrmTCPIP;
implementation
{$R *.dfm}
function WinsockEnabled: boolean;
var
wsaData: TWSAData;
begin
result := true;
case Winsock.WSAStartup($0101,wsaData) of
WSAEINVAL, WSASYSNOTREADY, WSAVERNOTSUPPORTED: result := false;
else Winsock.WSACleanup;
end;
end;
procedure TFrmTCPIP.BtnCheckClick(Sender: TObject);
begin
if WinsockEnabled then
RGPISInstall.ItemIndex:=0
else
RGPISInstall.ItemIndex:=1;
end;
procedure TFrmTCPIP.BtnCloseClick(Sender: TObject);
begin
Close;
end;
end.