التعامل مع اللست فيو
#6
هذا الكود كامل

procedure TForm1.Button1Click(Sender: TObject);
var
http :TIdHTTP;
reg: IRegExp2;
MatchCollection: IMatchCollection2;
Match1: IMatch2;
match: ISubMatches;
txt Confusedtring;
i : integer;
begin
reg := CoRegExp.Create;
reg.Global := True;
reg.IgnoreCase:=true;
reg.Pattern := '<a class="internal-link" href="http://filehippo.com.*?title="([a-z0-9\s!.]+)">[\S\s]+?<img src="(.*?.png)"/>';
http:=TIdHTTP.Create(nil);
txt:= http.Get ('http://filehippo.com/fr/software/antimalware/');
http.Request.UserAgent:='Mozilla/5.0 (Windows NT 6.1; rv:48.0) Gecko/20100101 Firefox/48.0';
MatchCollection := reg.Execute(txt) as IMatchCollection2;

if MatchCollection.Count = 0 then exit;
Match1 := MatchCollection.Item[0] as IMatch2;
match := Match1.SubMatches as ISubMatches;
begin
for match in MatchCollection do
begin
ListView1.Items.Item[i].Caption := match [0];//program names
ListView1.Items[i].SubItems.Add(match [1]);//link
inc(i)
end;
IdHTTP1.Free;
end;
end;


الخطا هو

dcc32 Error] Unit1.pas(58): E2431 for-in statement cannot operate on collection type 'IMatchCollection2' because 'IMatchCollection2' does not contain a member for 'GetEnumerator', or it is inaccessible
الرد


الردود في هذا الموضوع
التعامل مع اللست فيو - بواسطة mohamed49 - 22-12-2016, 12:36 PM
RE: التعامل مع اللست فيو - بواسطة rahiche - 23-12-2016, 06:16 PM
RE: التعامل مع اللست فيو - بواسطة mohamed49 - 23-12-2016, 06:56 PM
RE: التعامل مع اللست فيو - بواسطة rahiche - 23-12-2016, 10:00 PM
RE: التعامل مع اللست فيو - بواسطة mohamed49 - 24-12-2016, 07:41 AM
RE: التعامل مع اللست فيو - بواسطة mohamed49 - 25-12-2016, 07:59 AM
RE: التعامل مع اللست فيو - بواسطة mobile - 25-12-2016, 10:07 PM
RE: التعامل مع اللست فيو - بواسطة mohamed49 - 26-12-2016, 08:34 PM
RE: التعامل مع اللست فيو - بواسطة takaya5 - 20-03-2017, 09:36 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم