请问一下为什么同一个程序,其他人可以正常运行,而我编译时提示delphi invalid argument to date encode这个错误呢?
代码如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,IdHTTP;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function GetURLFile(strURL, strFileName: string): boolean;
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
Msg: TMsg;
SL: TStringList;
I: Integer;
begin
GetURLFile('http://passport.csdn.net/ShowExPwd.aspx?DateTime=2006-05-19%2023:08:38&strimg=0.8544980050337276','E:\a.jpg');
end;
function TForm1.GetURLFile(strURL, strFileName: string): boolean;
var
ms:TMemoryStream;
idhttp: Tidhttp;
begin
ms:=TMemoryStream.Create;
Result:=true;
idhttp := TIdHTTP.Create(nil);
try
idhttp.Get(strURL,ms);
ms.Position:=0;
ms.SaveToFile(strFileName);
except
Result:=false;
end;
ms.Free;
end;end.
~~~~~~~~~~
希望各位大侠多多帮忙
代码如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,IdHTTP;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function GetURLFile(strURL, strFileName: string): boolean;
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
Msg: TMsg;
SL: TStringList;
I: Integer;
begin
GetURLFile('http://passport.csdn.net/ShowExPwd.aspx?DateTime=2006-05-19%2023:08:38&strimg=0.8544980050337276','E:\a.jpg');
end;
function TForm1.GetURLFile(strURL, strFileName: string): boolean;
var
ms:TMemoryStream;
idhttp: Tidhttp;
begin
ms:=TMemoryStream.Create;
Result:=true;
idhttp := TIdHTTP.Create(nil);
try
idhttp.Get(strURL,ms);
ms.Position:=0;
ms.SaveToFile(strFileName);
except
Result:=false;
end;
ms.Free;
end;end.
~~~~~~~~~~
希望各位大侠多多帮忙
解决方案 »
- bring to front
- Adquery和dbgrid使用时,如何定位记录给文本输入框!!!
- 如果要存储包括各种类型的文件作为某个记录的附件,怎样存储???
- ***[初学记]***ADOQuery输出参数一问
- 问:该调用什么API获取可执行文件(.Exe,.Dll等)的版本,公司名称,程序名称等信息呢?
- 100分:请问如何修改EXE文件的标题?在线等待.........
- dbgrid1.options.dgMultiSelect:=true;这句话为什么有错误?
- 各位兄弟,怎样制作特效窗口?
- 输入法的问题
- 很简单但我不懂的问题
- 有一个库调用的问题
- 急。adoquery1.append之后。怎么才能让鼠标点一下就到我指定的行。
完整的错误提示是:
Project Project1.exe raised exception Class EconvertError with message 'invalid argument to date encode'
Process stopped.Use step or run to continue.
时间编码非法参数