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

📄 cliunit1.pas

📁 Delphi快速开发Web Server
💻 PAS
字号:
unit CliUnit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, rtcFunction, rtcDataCli, rtcCliModule, rtcInfo,
  rtcConn, rtcHttpCli;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Memo1: TMemo;
    RtcHttpClient1: TRtcHttpClient;
    RtcClientModule1: TRtcClientModule;
    RtcResult1: TRtcResult;
    procedure RtcResult1Return(Sender: TRtcConnection; Data,
      Result: TRtcValue);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.RtcResult1Return(Sender: TRtcConnection; Data,
  Result: TRtcValue);
begin
Memo1.Lines.Add(Result.asString);
end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key=#13 then
    with RtcClientModule1, Data do
      begin
      Edit1.SelectAll;
      // Prepare your function call
      with newFunction('hello') do
        asString['name']:=Edit1.Text;
      Call(RtcResult1); // Call the function
      end;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  begin
  RtcHttpClient1.Disconnect;
  end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -