⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.pas

📁 这是一个DELPHI7应用案例开发篇有配套程序种子光盘
💻 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 + -