Ĺadny brzuch
Witam. Mam taki problem. Chciałbym zrobić program, który będzie odczytywał z LISTBOX'a linki i automatycznie dodawał je do flashget'a ( najlepiej aby nie pojawiało się okienko proszące o potwierdzenie).
Musisz znać uchwyt okna FlashGeta, a potem w pętli wykonujesz odpowiednie operacje(klikasz na buttony flash geta itd)
Użytkownik loguś edytował ten post 31 maj 2007, 15:57
Musisz znać uchwyt okna FlashGeta, a potem w pętli wykonujesz odpowiednie operacje(klikasz na buttony flash geta itd)
sądzę że istnieje na to jakaś inna metoda - można by podpatrzeć jak robi to np. flashgot (rozszerzenie do FF)
zapewne uruchamia program z odpowiednimi parametrami :)
Ok. Dzięki za podpowiedzi. Ale pojawił się nowy problem. Znalazłem Komponent na torry.net o nazwie FlashGet. Wszystko w nim chodzi. Niestety jedynym problemem jest to , że pobiera on pliki z linków, które znajdują się w kodzie i nie można samemu wpisać. Starałem się tam coś zmienić ale na marne.
Czy moglibyście zobaczyć, czy da się coś przerobić?
Oto kod:
nit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,FlashGet, StdCtrls, DDEml,DdeMan; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Button5: TButton; ListBox1: TListBox; FlashGet1: TFlashGet; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin FlashGet1.AddUrl('http://www.amazesoft.com/fgf076.zip','FlashGet 0.76','http://www.amazesoft.com/download.htm'); end; [b]procedure TForm1.Button2Click(Sender: TObject); var URLs:TFlashGetURLs; begin AppendURL(URLS,'http://www.amazesoft.com/fgf076.zip','FlashGet 0.76'); AppendURL(URLS,'http://www.amazesoft.com/doc.zip','FlashGet Documentation'); FlashGet1.AppendURLs(URLs,'http://www.amazesoft.com'); end;[/b] procedure TForm1.Button3Click(Sender: TObject); begin if FlashGet1.IsUrlExist('http://www.amazesoft.com/fgf087.zip') then ShowMessage('Url Exist!') else ShowMessage('Url not found!'); end; procedure TForm1.Button4Click(Sender: TObject); var hszService, hszTopic, hszItem:HSZ; _hConv:HConv; begin hszService:=DdeCreateStringHandle(DdeMgr.DdeInstId,'FlashGet',0); hszTopic:=DdeCreateStringHandle(DdeMgr.DdeInstId, 'WWW_OPENURL',0); _hConv:=DdeConnect(DdeMgr.DdeInstId, hszService, hszTopic, nil); if _hConv<>0 then begin hszItem:=DdeCreateStringHandle(DdeMgr.DdeInstId,'http://www.amazesoft.com/fgf087.zip'+#13+#10+ //Main url 'http://mirrorsite/fgf087.zip,'+ // mirror url 'c:\downloads,'+ //Folder for save 'http://www.amazesoft.com/download.htm', 0); //referer DdeClientTransaction(nil, 0, _hConv, hszItem, CF_TEXT, XTYP_REQUEST, 500,nil); DdeDisconnect(_hConv); DdeFreeStringHandle(DdeMgr.DdeInstId, hszItem); end; DdeFreeStringHandle(DdeMgr.DdeInstId, hszService); DdeFreeStringHandle(DdeMgr.DdeInstId, hszTopic); end; procedure TForm1.Button5Click(Sender: TObject); var hszService, hszTopic, hszItem:HSZ; _hConv:HConv; hData:HDDEDATA; Index:Integer; begin ListBox1.Clear; hszService:=DdeCreateStringHandle(DdeMgr.DdeInstId,'FlashGet',0); hszTopic:=DdeCreateStringHandle(DdeMgr.DdeInstId, 'DOWNLOADINFO',0); _hConv:=DdeConnect(DdeMgr.DdeInstId, hszService, hszTopic, nil); if _hConv<>0 then begin Index:=1; repeat hszItem:=DdeCreateStringHandle(DdeMgr.DdeInstId, PChar(IntToStr(Index)),0); hData:=DdeClientTransaction(nil, 0, _hConv, hszItem, CF_TEXT, XTYP_REQUEST, 500, nil); if hData<>0 then begin ListBox1.Items.Append(String(PChar(DdeAccessData(hData, nil)))); DdeUnaccessData(hData); DdeFreeDataHandle(hData); end; DdeFreeStringHandle(DdeMgr.DdeInstId,hszItem); Inc(Index); until hData=0; DdeDisconnect(_hConv); end; DdeFreeStringHandle(DdeMgr.DdeInstId, hszService); DdeFreeStringHandle(DdeMgr.DdeInstId, hszTopic); end; end.
Najbardziej zależy mi na kodzie przypisanym buttonowi 2. Czy dało by rade zrobić coś takiego aby pobierał on linkin z ListBox'a (nowa linijka, nowy link)?
Użytkownik jin edytował ten post 02 czerwiec 2007, 18:52
procedure TForm1.Button2Click(Sender: TObject); var URLs:TFlashGetURLs; i:integer; begin for i:=0 to ListBox1.Items.Count-1 do AppendURL(URLS,ListBox1.Item[i],ListBox2.Item[i]); end; FlashGet1.AppendURLs(URLs,Edit1.Text); end;
Edit1 - Server
ListBox1 - Adres
ListBox2 - Opis
PS. Kod z pamięci więc coś może nie działać.
zanotowane.pl doc.pisz.pl pdf.pisz.pl zsf.htw.pl
Musisz znać uchwyt okna FlashGeta, a potem w pętli wykonujesz odpowiednie operacje(klikasz na buttony flash geta itd)
Użytkownik loguś edytował ten post 31 maj 2007, 15:57
Musisz znać uchwyt okna FlashGeta, a potem w pętli wykonujesz odpowiednie operacje(klikasz na buttony flash geta itd)
sądzę że istnieje na to jakaś inna metoda - można by podpatrzeć jak robi to np. flashgot (rozszerzenie do FF)
zapewne uruchamia program z odpowiednimi parametrami :)
Ok. Dzięki za podpowiedzi. Ale pojawił się nowy problem. Znalazłem Komponent na torry.net o nazwie FlashGet. Wszystko w nim chodzi. Niestety jedynym problemem jest to , że pobiera on pliki z linków, które znajdują się w kodzie i nie można samemu wpisać. Starałem się tam coś zmienić ale na marne.
Czy moglibyście zobaczyć, czy da się coś przerobić?
Oto kod:
nit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,FlashGet, StdCtrls, DDEml,DdeMan; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Button5: TButton; ListBox1: TListBox; FlashGet1: TFlashGet; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin FlashGet1.AddUrl('http://www.amazesoft.com/fgf076.zip','FlashGet 0.76','http://www.amazesoft.com/download.htm'); end; [b]procedure TForm1.Button2Click(Sender: TObject); var URLs:TFlashGetURLs; begin AppendURL(URLS,'http://www.amazesoft.com/fgf076.zip','FlashGet 0.76'); AppendURL(URLS,'http://www.amazesoft.com/doc.zip','FlashGet Documentation'); FlashGet1.AppendURLs(URLs,'http://www.amazesoft.com'); end;[/b] procedure TForm1.Button3Click(Sender: TObject); begin if FlashGet1.IsUrlExist('http://www.amazesoft.com/fgf087.zip') then ShowMessage('Url Exist!') else ShowMessage('Url not found!'); end; procedure TForm1.Button4Click(Sender: TObject); var hszService, hszTopic, hszItem:HSZ; _hConv:HConv; begin hszService:=DdeCreateStringHandle(DdeMgr.DdeInstId,'FlashGet',0); hszTopic:=DdeCreateStringHandle(DdeMgr.DdeInstId, 'WWW_OPENURL',0); _hConv:=DdeConnect(DdeMgr.DdeInstId, hszService, hszTopic, nil); if _hConv<>0 then begin hszItem:=DdeCreateStringHandle(DdeMgr.DdeInstId,'http://www.amazesoft.com/fgf087.zip'+#13+#10+ //Main url 'http://mirrorsite/fgf087.zip,'+ // mirror url 'c:\downloads,'+ //Folder for save 'http://www.amazesoft.com/download.htm', 0); //referer DdeClientTransaction(nil, 0, _hConv, hszItem, CF_TEXT, XTYP_REQUEST, 500,nil); DdeDisconnect(_hConv); DdeFreeStringHandle(DdeMgr.DdeInstId, hszItem); end; DdeFreeStringHandle(DdeMgr.DdeInstId, hszService); DdeFreeStringHandle(DdeMgr.DdeInstId, hszTopic); end; procedure TForm1.Button5Click(Sender: TObject); var hszService, hszTopic, hszItem:HSZ; _hConv:HConv; hData:HDDEDATA; Index:Integer; begin ListBox1.Clear; hszService:=DdeCreateStringHandle(DdeMgr.DdeInstId,'FlashGet',0); hszTopic:=DdeCreateStringHandle(DdeMgr.DdeInstId, 'DOWNLOADINFO',0); _hConv:=DdeConnect(DdeMgr.DdeInstId, hszService, hszTopic, nil); if _hConv<>0 then begin Index:=1; repeat hszItem:=DdeCreateStringHandle(DdeMgr.DdeInstId, PChar(IntToStr(Index)),0); hData:=DdeClientTransaction(nil, 0, _hConv, hszItem, CF_TEXT, XTYP_REQUEST, 500, nil); if hData<>0 then begin ListBox1.Items.Append(String(PChar(DdeAccessData(hData, nil)))); DdeUnaccessData(hData); DdeFreeDataHandle(hData); end; DdeFreeStringHandle(DdeMgr.DdeInstId,hszItem); Inc(Index); until hData=0; DdeDisconnect(_hConv); end; DdeFreeStringHandle(DdeMgr.DdeInstId, hszService); DdeFreeStringHandle(DdeMgr.DdeInstId, hszTopic); end; end.
Najbardziej zależy mi na kodzie przypisanym buttonowi 2. Czy dało by rade zrobić coś takiego aby pobierał on linkin z ListBox'a (nowa linijka, nowy link)?
Użytkownik jin edytował ten post 02 czerwiec 2007, 18:52
procedure TForm1.Button2Click(Sender: TObject); var URLs:TFlashGetURLs; i:integer; begin for i:=0 to ListBox1.Items.Count-1 do AppendURL(URLS,ListBox1.Item[i],ListBox2.Item[i]); end; FlashGet1.AppendURLs(URLs,Edit1.Text); end;
Edit1 - Server
ListBox1 - Adres
ListBox2 - Opis
PS. Kod z pamięci więc coś może nie działać.