提示错误:
Project index.exe raised excpetion class EConvertError with message 'Invalid argument to date encode'. process stopped. use step or Run to continue 我查看过代码。我用他GET其他的站点是好好的。就唯独打开google的时候就出现这样的问题了..
function Tseogoogle.Get(URL: string):string; //转换地址代替了idhttp
var
IDHTTP: TIDHttp;
ss: String;
begin
IDHTTP:= TIDHTTP.Create(nil);
try
try
idhttp.Disconnect;
idhttp.HandleRedirects:= true; //必须支持重定向否则可能出错
idhttp.ReadTimeout:= 15000; //超过这个时间则不再访问
Idhttp.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)';
ss:=utf8toansi(idhttp.Get(url)); //UTF8编码转换
if IDHTTP.ResponseCode=200 then
Result :=ss;
except
ss:=' ';
end;
finally
IDHTTP.Free;
end;
end;
这是我写的代码。麻烦帮忙看看
Project index.exe raised excpetion class EConvertError with message 'Invalid argument to date encode'. process stopped. use step or Run to continue 我查看过代码。我用他GET其他的站点是好好的。就唯独打开google的时候就出现这样的问题了..
function Tseogoogle.Get(URL: string):string; //转换地址代替了idhttp
var
IDHTTP: TIDHttp;
ss: String;
begin
IDHTTP:= TIDHTTP.Create(nil);
try
try
idhttp.Disconnect;
idhttp.HandleRedirects:= true; //必须支持重定向否则可能出错
idhttp.ReadTimeout:= 15000; //超过这个时间则不再访问
Idhttp.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)';
ss:=utf8toansi(idhttp.Get(url)); //UTF8编码转换
if IDHTTP.ResponseCode=200 then
Result :=ss;
except
ss:=' ';
end;
finally
IDHTTP.Free;
end;
end;
这是我写的代码。麻烦帮忙看看
ss:=utf8toansi(idhttp.Get(url)); //UTF8编码转换