哈,哈,看:
(*)
从菜单 File->New...->web server Applicaion->ISAPI/NSAPI Dynanic Link Lib 建项目,
将 Project1.dpr 改名为 Test1.dpr 保存,以便生成 Test1.Dll 。
(*)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, HTTPApp;
type
TWebModule1 = class(TWebModule)
procedure WebModuleBeforeDispatch(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
Content:String;
end;
var
WebModule1: TWebModule1;
implementation
{$R *.DFM}
procedure TWebModule1.WebModuleBeforeDispatch(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Content:=Request.ContentFields.Values['s']; // 截获输入
end;
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Response.Content:= Content; // 显示结果
end;
end.
怎么安装,怎么设置,应该会吧。
POST 语法举例:
<form method="POST" action="./Scripts/Test1.dll?">
<input type="text" name="s" value="abbbf" size="20">
<input type="submit" value="Post" name="postit">
</form>