该URL如:http://www.xxx.com/getvalue.asp?id=xxx需要向它发送一个请求,然后取得返回值。
在VB中是这样实现的
private sub btn_click()
set inet=createobject("inetctls.inet")
inet.url="http://www.xxx.com/getvalue.asp?id=xxx"
inet.accesstype=0
inet.requesttimeout=100
text1.text=inet.openurl()
set inet=noting
end sub如果是用xmlhttp,那么该如何声明,是否需要单独安装?我要做一个绿色软件。
在VB中是这样实现的
private sub btn_click()
set inet=createobject("inetctls.inet")
inet.url="http://www.xxx.com/getvalue.asp?id=xxx"
inet.accesstype=0
inet.requesttimeout=100
text1.text=inet.openurl()
set inet=noting
end sub如果是用xmlhttp,那么该如何声明,是否需要单独安装?我要做一个绿色软件。
解决方案 »
- 如何获得网络驱动全路径?
- 堆栈溢出的问题!(请高手指点一二)感激不尽
- delphi7与interbase数据库连接问题
- 如何求出Grid中一列數據的和?
- 在哪找Dhtmledit控件?高手请进
- 怎樣知道表單上一類駔件(如Dbedit1﹐Dbedit2,Dbedit2,...Dbeditn)的個數,再根據個數依次對Dbedit1﹐Dbedit2,Dbedit2,...Dbeditn的shu性
- 鼠标移动离开图片时,图片不变化的问题?
- 招聘北京delphi程序员
- Access不支持关连多表的Update吗?
- 这个API函数如何在DELPHI中调用?
- 急,急,谁有检测内存泄漏的代码片断
- 如何共享電腦的com端口?
如:
http://www.enet.com.cn/eschool/inforcenter/A20040429306316.html
var
DownLoadFile:TFileStream;
beginio
DownLoadFile:=TFileStream.Create('c:\aa.rar',fmCreate);
IdHTTP1.Get('http://www.sina.com.cn/download/aa.rar',DownLoadFile);
DownLoadFile.Free;
end;
uses IdMultipartFormData; { .... } procedure TForm1.Button1Click(Sender: TObject);
var
data: TIdMultiPartFormDataStream;
begin
data := TIdMultiPartFormDataStream.Create;
try
{ add the used parameters for the script }
data.AddFormField('param1', 'value1');
data.AddFormField('param2', 'value2');
data.AddFormField('param3', 'value3'); { Call the Post method of TIdHTTP and read the result into TMemo }
Memo1.Lines.Text := IdHTTP1.Post('http://localhost/script.php', data);
finally
data.Free;
end;
end;