想做一个像:FlashGet那样的软件。小弟现在一点头绪都没有.
请高手说说怎么做?
用什么控件.
我还想到了一个问题
比如:http://www.xxxx.com/down.asp?id=1
这样子的URL我怎么下载下来!这个ULR是连接到一个软件的。

解决方案 »

  1.   

    uses 
    URLMon, ShellApi;function DownloadFile(SourceFile, DestFile: string): Boolean;begintryResult := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;exceptResult := False;end;end;procedure TForm1.Button1Click(Sender: TObject);const// URL LocationSourceFile = 'http://www.google.com/intl/de/images/home_title.gif';// Where to save the fileDestFile = 'c:image.gif';beginif DownloadFile(SourceFile, DestFile) thenbeginShowMessage('Download succesful!');// Show downloaded image in your browserShellExecute(Application.Handle, PChar('open'), PChar(DestFile),PChar(''), nil, SW_NORMAL)endelseShowMessage('Error while downloading ' + SourceFile)end;// Minimum availability: Internet Explorer 3.0// Minimum operating systems Windows NT 4.0, Windows 95******************************2.}usesWininet;function DownloadURL(const aUrl: string): Boolean;varhSession: HINTERNET;hService: HINTERNET;lpBuffer: array[0..1024 + 1] of Char;dwBytesRead: DWORD;beginResult := False;// hSession := InternetOpen( 'MyApp', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);tryif Assigned(hSession) thenbeginhService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0);if Assigned(hService) thentrywhile True dobegindwBytesRead := 1024;InternetReadFile(hService, @lpBuffer, 1024, dwBytesRead);if dwBytesRead = 0 then break;lpBuffer[dwBytesRead] := #0;Form1.Memo1.Lines.Add(lpBuffer);end;Result := True;finallyInternetCloseHandle(hService);end;end;finallyInternetCloseHandle(hSession);end;end;******************************在Delphi中如何从网络中提取一个文件到本地计算机中,如提取<BR> http://www.abcdefg.com/software/a.zip到本地指定的目录中?在窗体中添加1个TNMHTTP控件(在FastNet页)然后在随便那个Button什么的下面加入如下代码: NMHTTP1.InputFileMode := ture;NMHTTP1.Body := '本地文件名';NMHTTP1.Header := 'Head.txt';NMHTTP1.OutputFileMode := FALSE;NMHTTP1.ReportLevel := Status_Basic;NMHTTP1.Proxy := '代理服务器的IP地址';NMHTTP1.ProxyPort := '代理服务器的端口号';With NMHTTP1.HeaderInfo doBeginCookie := '';LocalMailAddress := '';LocalProgram := '';Referer := '';UserID := '用户名称';Password := '用户口令';End;NMHTTP1.Get(‘http://www.abcdefg.com/software/a.zip’);试试吧,Delphi的目录中有TNMHTTP控件的例子。NT4+,Win95+,IE3+,你可以用URL Moniker的功能。uses URLMon;...OleCheck(URLDownloadToFile(nil,'URL','Filename',0,nil));其中最后一个参数你还可以传入一个IBindStatusCallback的实现以跟踪下载进度或控制中止下载。简单的场合一句话就搞定了。 
     
       
      

  2.   

    看了一下还可以。
    TO: fhuibo(Sailor) 
    如果我想下载:
    http://www.xxx.com/down/show.asp?id=9&down=1
    中对应的软件怎么办?
    我试过的不行啊。
    如果是:
    http://www.xxx.com/down/abc.zip
    就可以的。
    谢谢!
    请高手指点一下!
      

  3.   

    谢谢你: fhuibo(Sailor) 
    我先把贴子结了。
    给你全分。
    你有空帮我看看我没有解决的问题。
    我给了200分。
    地址:
    http://expert.csdn.net/Expert/topic/2211/2211323.xml?temp=.1722528