七
七步子
Unregistered / Unconfirmed
GUEST, unregistred user!
我用IdHTTPServer做一个服务器!
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
IdHTTPServer1.Bindings.Clear;
IdHTTPServer1.DefaultPort:=80;
IdHTTPServer1.Bindings.Add;
IdHTTPServer1.Active:=true;
end;
procedure TForm1.IdHTTPServer1CommandGet(AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
AResponseInfo.ResponseNo:=404;
AResponseInfo.ContentText :=
'<html><head><title>Error</title></head><body><h1>' +
AResponseInfo.ResponseText + '</h1></body></html>';
end;
用以上代码已经可以用Internet Explorer连上了,但在Demos有个例子是可以设置它的目录的像IIS可以设置虚拟目录在硬盘的路径一样,这个我就不会搞了,请各位高手指点给出代码或例子说明~~~谢谢!!
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
IdHTTPServer1.Bindings.Clear;
IdHTTPServer1.DefaultPort:=80;
IdHTTPServer1.Bindings.Add;
IdHTTPServer1.Active:=true;
end;
procedure TForm1.IdHTTPServer1CommandGet(AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
AResponseInfo.ResponseNo:=404;
AResponseInfo.ContentText :=
'<html><head><title>Error</title></head><body><h1>' +
AResponseInfo.ResponseText + '</h1></body></html>';
end;
用以上代码已经可以用Internet Explorer连上了,但在Demos有个例子是可以设置它的目录的像IIS可以设置虚拟目录在硬盘的路径一样,这个我就不会搞了,请各位高手指点给出代码或例子说明~~~谢谢!!