The following is the function definition:
The function countnum (url: String, FileName: String, param: String) : String; Stdcall; Export;
End.
As shown in figure: Delphi a great god grant instruction.
CodePudding user response:
The library Project1.
USES the
SysUtils IdBaseComponent, IdComponent IdTCPConnection, IdTCPClient,
IdHTTP Classes;
The function countnum (url, FileName, param: String) : String; Stdcall;
Var
HTTP: TIdHTTP;
ParamPost: TStringList;
The begin
HTTP:=TIdHTTP. Create (nil);
ParamPost:=TStringList. The Create ();
Try
ParamPost. Add (param);
HTTP. ReadTimeout: 30 *=1000;
Result:=HTTP Post (url + FileName, ParamPost);
The finally
FreeAndNil (HTTP).
ParamPost. Free ();
The end;
The end;
The end;
{$R *. Res}
Exports
Countnum;
The begin
End.
The above code untested, but compilation should be error free