各位大虾,请问在Delphi中如何通过HTTPS下载文件或访问网页???有相关的Component吗?

解决方案 »

  1.   

    不明白你的意思,你是做服务器还是客户端阿?
    在html格式中直接用<a href  file......>,客户就可以点击下载了.
      

  2.   

    是在Delphi中,當然是客戶端。
      

  3.   

    在html格式中直接用<a href  file......>  這是通过HTTPS的。
      

  4.   

    直接放一个WebBrowse主件,然后Navigate('Https://*.*.*.*/');
      

  5.   

    看看这个:
    http://www.secureblackbox.com/delphi-ssl.html
      

  6.   

    For Delphi component and having Active dll
      

  7.   

    wininet的httpGet能把URL上的主页内容Get下来:
    unit ReadHttpFiles;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, wininet,
      StdCtrls, ComCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        RichEdit1: TRichEdit;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
      hIs, hIc, hIR : Hinternet;
      pcbuf : pChar;
      dwRead : Dword;
    begin
      dwRead := 0;
      GetMem(pcbuf,1024);
      hIs := InternetOpen('HttpGet', INTERNET_OPEN_TYPE_DIRECT,
                            NIL, NIL,0);
      hIc := InternetConnect(hIs, 'www.microsoft.com', INTERNET_DEFAULT_HTTP_PORT,
                            NIL, NIL, INTERNET_SERVICE_HTTP,0,0);
      hIR := HttpOpenRequest(hIC, nil, '/Default.asp', nil, nil,nil, 0,0);
      if HttpSendRequest(hIR, nil, 0,nil,0) then
      begin
        while InternetReadFile(hIR, pcbuf,1024,dwRead) do
        begin
          if dwRead <= 0 then break;
          RichEdit1.Text  := RichEdit1.text + pcBuf;
        end;
      end;
      InternetCloseHandle(hIR);
      InternetCloseHandle(hIC);
      InternetCloseHandle(hIs);
      FreeMem(pcBuf);
    end;end.
    需要把上面例子的"www.microsoft.com"改为你上拿的网站, 
                   "/default.asp" 改为你要的html文件.
      

  8.   

    There are a number of ways to do this, below is a simple code snippit that will give you an idea of how to do this. Make sure to add ShellApi, and UrlMon to your uses clause. 
    function DownLoadInternetFile(Source, Dest : String): Boolean;
    begin
      try
        Result := URLDownloadToFile(nil,PChar(Source),PChar(Dest),0,nil) = 0
      except
        Result := False;
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    var
      SourceString, DestinationString: string;
    begin
    //File location on the Internet.
      SourceString := 'http://www.borland.com/images/homepage/del6homemural.gif';
    //File destination.
      DestinationString := 'C:Tempdel6homemural.gif';  if DownLoadInternetFile(SourceString, DestinationString) then
    //This will display the file from your browser.
        ShellExecute(Application.Handle, PChar('Open'), PChar(DestinationString), PChar(''), nil, SW_NORMAL)
      else
        ShowMessage('Error during Download ' + SourceString);
    end; 
      

  9.   

    编号: 139 发送者 Wnyu 发送时间 2003-5-22 12:14:52 删除  回复  
    内容 请问indy控件有没有控制Https的元件???
    http://expert.csdn.net/Expert/topic/1806/1806565.xml?temp=.9563867
    _______________________________________________________________________________
     老兄﹐近來在什么地方發達﹐
    indy的6.0以上的版本已包含了 Https的類可不﹐可以到這里下載一個更好的﹕
    www.nsoftware.comTradelink現在的部分客戶也轉用了HTTPS來代替Smtp和Pop3了﹐因為更安全。