📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 = class(TForm)
edQuery: TEdit;
btnSearch: TButton;
StringGrid1: TStringGrid;
procedure btnSearchClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses GoogleSearch,HTTPApp;
{$R *.dfm}
procedure TForm1.btnSearchClick(Sender: TObject);
var
Results: GoogleSearchResult;
i: Integer;
begin
Results := GetGoogleSearchPort.doGoogleSearch('6dORLvhQFHJnGi7RupeCmlz78gEDhpjR',
HTTPEncode(edQuery.Text), 0, 10, True, '', True, 'lang_en', 'latin1', 'latin1');
Caption := Format('%d results in %.2n seconds',
[Results.estimatedTotalResultsCount,Results.searchTime]);
for i:=Low(Results.resultElements) to High(Results.resultElements) do
begin
StringGrid1.Cells[0,Succ(i)] := Results.resultElements[i].title;
StringGrid1.Cells[1,Succ(i)] := Results.resultElements[i].URL;
StringGrid1.Cells[2,Succ(i)] := Results.resultElements[i].cachedSize
end
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -