Delphi下,如何接受来自Web页的请求(100分)

  • 主题发起人 liu2909432
  • 开始时间
L

liu2909432

Unregistered / Unconfirmed
GUEST, unregistred user!
如果用别的工具如DreamWeaver作的王爷,要通过 Delphi 与各种数据库相连,那么
Delphi下如何接受来自网页的请求并产生相应动作
 
搜索一下isapi 方面的资料 好好看看就知道了
 
Delphi6/demos/indy/HttpClient
有例子
 
你指的是当点击网页中的连接,把相关的连接信息交给自己的应用程序来处理吗?
如果是这样的话就需要借助ActivX组件了。因为你可以想一想单纯的网页中的超
连接与表单的提交动作是无法通知给应用程序的,但是在网页中是可以嵌入自己
写的ActivX,在网页中可以调用ActivX组件中的方法,而ActivX组件就可以想办法
与你的应用程序通讯了。
 
写一个小的Web服务器 就可以阿
 
用Delphi写一个CGI或ISAPI,编译成EXE或DLL,负责存取数据库,如下面的代码:
procedure TWebModule1.WebModule1WebActionItem5Action(Sender: TObject;
Request: TWebRequest;
Response: TWebResponse;
var Handled: Boolean);
var username,password:string;
list:tstringlist;
begin
// 读取网页提交过来的两个文本框里的内容
username:= Request.ContentFields.Values['t1'];
password:= Request.ContentFields.Values['t2'];
if (username='sqslj') and(password='sq121') then
//重新定向网页
response.SendRedirect('http://yddn/sqweather/cgi.exe/start')
else
begin
list:=tstringlist.Create ;
with listdo
begin
//生成一个提示用户名、密码错误的网页
add('......');
add ......
end;
response.content:=list.text;
list.free;
end;

在网页里的提交数据的FORM的 action指向该CGI,如:
<form action="http://xxx.xxx.xxx.x/cgi.exe/login" method="POST">
 
用webbroker技术或者intraweb技术
我用intraweb写的通用文档管理软件
http://www.datacn.com
用intraweb比较简单
 
我觉得liu2909432说的是Web形式的界面,而不是B/S模式需要Web Server。
 
看李维的电子商务篇。如果要原码,发Email给我sungirl1126@21cn.com
 
to:山泉:
写得太好了.
能提供源码学习一下吗?
xca113@21cn.com
 

Similar threads

D
回复
0
查看
797
DelphiTeacher的专栏
D
D
回复
0
查看
750
DelphiTeacher的专栏
D
D
回复
0
查看
832
DelphiTeacher的专栏
D
D
回复
0
查看
802
DelphiTeacher的专栏
D
顶部