unit jyb;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
tmpStream:TFileStream;
begin
tmpStream:=TFileStream.Create('c:\aa.zip',fmCreate);
try
idhttp1.Get('http://192.168.2.143:7001/z.zip',tmpStream);
finally
tmpStream.Free;
end;
end;
end.
转变成Console Application,高手请指教!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
tmpStream:TFileStream;
begin
tmpStream:=TFileStream.Create('c:\aa.zip',fmCreate);
try
idhttp1.Get('http://192.168.2.143:7001/z.zip',tmpStream);
finally
tmpStream.Free;
end;
end;
end.
转变成Console Application,高手请指教!
解决方案 »
- wParam=WM_LBUTTONDOWN为什么会卡住?怎么区分是哪个按钮点击的事件呢?
- indy10支持完成端口了,谁用过?
- webservices
- 被一帮万年海龟吸引回来了..那就发个三分贴吧...
- 在delphi2006中使用devexpress QuantumGrid遇到的问题
- 串口编程高手请进(解决我的串口编程问题)
- 大家帮忙,关于stringgrid单元格计算问题?谢谢!
- ClientSocket占用的资源在什么时候释放??
- 简单的问题,只要解决马上送分
- ADO如何连接SqlServer!哪位大虾快帮帮我!
- 请问那里有如果在局域网内容实现文件传输?
- 关于Gride列头的问题(在线解决就给分)
Windows, Messages, SysUtils, Variants, Classes, Controls, Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls;
procedure fun();
var
tmpStream:TFileStream;
idHttp1:TIDhttp;
begin
idHttp1:=TIDHttp.Create(Application);
tmpStream:=TFileStream.Create('c:\aa.zip',fmCreate);
try
idhttp1.Get('http://192.168.2.143:7001/z.zip',tmpStream);
finally
tmpStream.Free;
idHttp1.Free;
end;
end;
begin
fun();
end.
Application的属性就是工程的属性;
在某种意义上讲和最终的exe是一样的。你实验一下,这两个语句就能知道什么是Application,同时也知道什么是MainForm了。ShowWindow(Application.Handle, SW_HIDE);ShowWindow(Form1.Handle, SW_HIDE);
ShowWindow(Application.Handle, SW_HIDE); ShowWindow(Form1.Handle, SW_HIDE);
怎么执行啊?上边的程序应该怎样设置Application啊?
idHttp1怎么初始化啊?谢谢谢谢!