相关疑难解决方法(0)

Delphi:idHttp + SSL

请解释一下如何使用SSL(https://)从服务器下载文件.我没有在互联网上找到合适的答案.

每个人都说TIdSSLIOHandlerSocket,但我只有TIdSSLIOHandlerSocketOpenSSL.如果我使用TIdSSLIOHandlerSocketOpenSSL,我有一个错误'无法加载SSL库'.有人说它需要一个图书馆,但最不提的是它.我是否需要使用http://www.indyproject.org/sockets/SSL.EN.aspx中的库?

我在程序的文件夹中有这些DLL.根据:http://edn.embarcadero.com/article/31279 "在运行时,Indy尝试加载libeay32.dll和ssleay32.dll." 我不知道Indy试图加载DDL的位置 - >我有一个错误:'无法加载SSL库.'

procedure TForm1.FormCreate(Sender: TObject);
    var  UpdateMemoryStream:tmemorystream;
    begin
    try
    UpdateMemoryStream:=TMemoryStream.Create;
                try
                idhttp2.Get('https://example.com/list.rar',UpdateMemoryStream); //I have: Exception class EIdOSSLCouldNotLoadSSLLibrary with message 'Could not load SSL library.'
                except
                    on E : Exception do 
                    begin showmessage('Error: '+E.Message); 
                    end;
                end;
    UpdateMemoryStream.SaveToFile('d:\1.rar');
    finally
    UpdateMemoryStream.Free;
    end;
    end;
Run Code Online (Sandbox Code Playgroud)

为什么我有这个错误?我有Delphi 2010.

delphi ssl indy idhttp

12
推荐指数
2
解决办法
3万
查看次数

使用Delphi XE2进行tdownload

希望获得TDownloadURL的帮助使用此代码保存下载的文件.使用Delphi XE2.想要保存下载到内存/ tstringlist而不是文件.没有添加组件怎么做?谢谢!

notfound:=false;
dl := TDownloadURL.Create(self);
  try
    dl.URL := url;
    dl.FileName := execpath+'apic1.csv'; dl.ExecuteTarget(nil); dl.Free;
  except
    dl.Free;
    notfound:=true;
  end;
Run Code Online (Sandbox Code Playgroud)

delphi download delphi-xe2

-1
推荐指数
1
解决办法
270
查看次数

标签 统计

delphi ×2

delphi-xe2 ×1

download ×1

idhttp ×1

indy ×1

ssl ×1