delphi中能不能将数据用网页的POST方式,把数据传给一个ASP接收阿 (200分)

A

aocandy

Unregistered / Unconfirmed
GUEST, unregistred user!
delphi中能不能将数据用网页的POST方式,把数据传给一个ASP接收阿 [:)]
 
当然可以阿.

我倾向用第三方控件ics
里面有包含向某action post的例子.
这个工程:HTTPTST.DPR
下载装了自己看看吧,很简单的:D
 
怎么是空的 啊
 
alum这个论坛我第一次用,我再论坛上看不到你发的帖子,职能再邮件里看,你说的那个例子给我一份好么,传到我的email
aocandy@163.com
 
//delphi6自己带的一个例子
.....
HTTP: TIdHTTP;
......

procedure TForm1.btnGoClick(Sender: TObject);
var
Source: TMemoryStream;
Response: TStringStream;
begin
// Add the URL to the combo-box.
if cbURL.Items.IndexOf(cbURL.Text) = -1 then
cbURL.Items.Add(cbURL.Text);
Screen.Cursor := crHourGlass;
btnStop.Enabled := True;
btnGo.Enabled := False;
try
memoHTML.Clear;
// Set the properties for HTTP
HTTP.Request.Username := edUsername.Text;
HTTP.Request.Password := edPassword.Text;
HTTP.Request.ProxyServer := edProxyServer.Text;
HTTP.Request.ProxyPort := StrToIntDef(edProxyPort.Text, 80);
HTTP.Request.ContentType := edContentType.Text;
if cbSSL.Checked then
begin
HTTP.Intercept := SSL;
end
else
begin
HTTP.Intercept := LogDebug;
HTTP.InterceptEnabled := true;
end;

case cbMethod.ItemIndex of
0: // Head
begin
HTTP.Head(cbURL.Text);
memoHTML.Lines.Add('This is an example of some of the headers returned: ');
memoHTML.Lines.Add('---------------------------------------------------');
memoHTML.Lines.Add('Content-Type: ' + HTTP.Response.ContentType);
memoHTML.Lines.Add('Date: ' + DatetoStr(HTTP.Response.Date));
memoHTML.Lines.Add('');
memoHTML.Lines.Add('You can view all the headers by examining HTTP.Response');
end;
1: // Get
begin
memoHTML.Lines.Text := HTTP.Get(cbURL.Text);
end;
2: // Post
begin
Response := TStringStream.Create('');
try
if not bPostFile then
HTTP.Post(cbURL.Text, mePostData.Lines, Response)
else
begin
Source := TMemoryStream.Create;
try
Source.LoadFromFile(edPostFile.Text);
HTTP.Post(cbURL.Text, Source, Response);
finally
Source.Free;
end;
end;
memoHTML.Lines.Text := Response.DataString;
finally
Response.Free;
end;
end;
end;
finally
Screen.Cursor := crDefault;
btnStop.Enabled := False;
btnGo.Enabled := True;
end;
end;
 
http://overbyte.delphicenter.com/eng/products/ics.html
ics可以从这里下载.

包含了上面说的例子了.
 
不行阿,下不来,给我发一个把
 
你的Delphi版本是多少阿?
 
我的是DELPHI6.0的
 
http://overbyte.delphicenter.com/arch/ics.zip

文件有1mb多,
你看看能不能下.
不能下我就发过去给你.
 
不行阿,我这里http://overbyte.delphicenter.com这个网站根本找不到
 
发过去了:D:D
 
发到哪里去了阿
 
aocandy@163.com
发了两次
---------------------------------
发送成功

--------------------------------------------------------------------------------
您的信件已经成功发送到 aocandy@163.com

 
谢了,我正在接收
 
什么阿,没有6.0的阿
 
hehe ,简单的很,就是发送一个post请求就可以,internet组的http组件就可以搞定这个问题,没必要那么麻烦。
 
解压之后
Delphi/Vc32/IcsDel60.dpk
就是D6安装包。打开install即可

btw:Internet组确实能实现,iapollo的例子足以证明,
但是使用比较下来,还是觉得这套vcl确实不错。
我实现rfc1876的时候,比较了几套vcl,还是觉得ics的开发程度比其他要好。
(当然,是不修改源码的基础上)

话说回来,萝卜青菜各有所爱。我只是推荐这套vcl罢了。

 
http://www.playicq.com/dispdoc.php?t=19&id=1696
这里有下!不知怎么样,回去试试!
 
还没有人帮我解决问题那,给我控件怎么用阿,我想要例子
 
顶部