📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, IPEdit;
type
TForm1 = class(TForm)
Button1: TButton;
IPEdit1: TIPEdit;
Memo1: TMemo;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:Longword ;
begin
i:= IPEdit1.Fields[3].Value + IPEdit1.Fields[2].Value *256 + IPEdit1.Fields[1].Value *256*256 +
IPEdit1.Fields[0].Value *256*256 *256 ;
with ADOQuery1 do
begin
close;
sql.text:='select * from address where ip1 <= '+inttostr(i)+' and '+ inttostr(i)+' <=ip2' ;
open;
if RecordCount>0 then
begin
memo1.Lines.Clear;
memo1.Lines.Text:= FieldByName('country').AsString
end
else
showmessage('没有查到该IP');
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -