我用webBroker编写了一个简单的应用程序,我用的是win2000的iis5的服务器
unit Unit1;interfaceuses
SysUtils, Classes, HTTPApp;type
TWebModule1 = class(TWebModule)
procedure WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;var
WebModule1: TWebModule1;implementation{$R *.DFM}procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
A:String;
Page:TStringList;
begin
Page:=TStringList.Create;
try
with Page do begin
Add('<HTML>');
Add('<HEAD>');
Add('<TITLE>Web Server samples</TITLE>');
Add('</HEAD>');
Add('<BODY>');
A:=Request.URL;
Add('<P>URL='+A+'</P>');
A:=Request.Query;
Add('<P>From='+A+'</P>');
A:=Request.Host;
Add('<P>Host='+A+'</P>');
A:=Request.UserAgent;
Add('<P>UserAgent='+A+'</P>');
A:=Request.ContentType;
Add('<P>ContentType='+A+'</P>');
A:=Request.RemoteAddr;
Add('<P>RemoteAddr='+A+'</P>');
A:=Request.ProtocolVersion;
Add('<P>ProtocolVersion='+A+'</P>');
A:=Request.Connection;
Add('<p>Connection='+A+'</P>');
Add('<P> 这是我的第一个WEB应用程序范例</p>');
Add('</BODY>');
Add('</HTML>');
Response.Content:=Page.Text;
end;
finally
Page.Free;
end;
Handled:=True;
end;end.
照理说我直接在地址栏了写入:http//localhost/dll/websample.dll/sample就可以显示网页(入口为/sample,dll为虚拟目录,用的是isapi/nsapi dynamic link library),但不能显示网页,如果我把地址该为:http://localhost:5708/websample.dll/sample 就可以了,还有一点,我的iis服务器
如果我改了其中显示的内容,然后把生成的websample.dll拷贝到dll的虚拟目录。内容不会更新,非得重起才可以!
希望高手指点!这是为什么?
不胜感激!
unit Unit1;interfaceuses
SysUtils, Classes, HTTPApp;type
TWebModule1 = class(TWebModule)
procedure WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;var
WebModule1: TWebModule1;implementation{$R *.DFM}procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
A:String;
Page:TStringList;
begin
Page:=TStringList.Create;
try
with Page do begin
Add('<HTML>');
Add('<HEAD>');
Add('<TITLE>Web Server samples</TITLE>');
Add('</HEAD>');
Add('<BODY>');
A:=Request.URL;
Add('<P>URL='+A+'</P>');
A:=Request.Query;
Add('<P>From='+A+'</P>');
A:=Request.Host;
Add('<P>Host='+A+'</P>');
A:=Request.UserAgent;
Add('<P>UserAgent='+A+'</P>');
A:=Request.ContentType;
Add('<P>ContentType='+A+'</P>');
A:=Request.RemoteAddr;
Add('<P>RemoteAddr='+A+'</P>');
A:=Request.ProtocolVersion;
Add('<P>ProtocolVersion='+A+'</P>');
A:=Request.Connection;
Add('<p>Connection='+A+'</P>');
Add('<P> 这是我的第一个WEB应用程序范例</p>');
Add('</BODY>');
Add('</HTML>');
Response.Content:=Page.Text;
end;
finally
Page.Free;
end;
Handled:=True;
end;end.
照理说我直接在地址栏了写入:http//localhost/dll/websample.dll/sample就可以显示网页(入口为/sample,dll为虚拟目录,用的是isapi/nsapi dynamic link library),但不能显示网页,如果我把地址该为:http://localhost:5708/websample.dll/sample 就可以了,还有一点,我的iis服务器
如果我改了其中显示的内容,然后把生成的websample.dll拷贝到dll的虚拟目录。内容不会更新,非得重起才可以!
希望高手指点!这是为什么?
不胜感激!
http: //localhost:5708/websample.dll/sample 第一,你的端口号簿正确,对于IIS服务,可以由用户更改端口号。你的端口号现在看来是5708。
第二,你应当把文件拷贝到虚拟目录中去,对于文件的位置。
第三,站点发布是不因该重新启动后生效的,检查是否有其他的问题。