Bonjour à tous,

Je cherche à comparer le nom des fichiers '.exe' d'un dossier spécifique avec des strings chargées à partir d'un fichier ini.
Voilà comment je m'y prends :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
Function Stringsuspecte(S : String) : boolean;
var
  Ini : TIniFile;
  Strs : TStringList;
  I: Integer;
Begin
  Ini := TIniFile.Create(ExtractFilePath(ParamStr(0))+'SUMBConf.ini');
  Strs := TStringList.Create();
  Ini.ReadSection('String', Strs);
  for I := 0 to Strs.Count- 1 do
  Begin
    if Pos(Strs.Strings[i],S)<>0 then
      begin
        Result := True;
        Exit();
      end;
  End;
  Result := False;
  Ini.Free;
end;
Le test ne se fait pas : l'itemindex max de ma stringlist Strs est à 0.
Alors que mon fichier ini se compose comme suit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
[Exclu]
 
[String]
ins
Uninstall
update
 
[Ext]
.lnk=
.exe=
Je ne comprends pas pourquoi Strs ne se remplit pas =X

Merci de votre aide =)

Omg...
mon fichier ini...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
[Exclu]

 [String]
 ins=
 Uninstall=
 update=

 [Ext]
 .lnk=
 .exe=


^^
Désolé pour le post..