Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionprocedure TForm1.Button2Click(Sender: TObject); var StringList: TStringList; FileName, S: string; I: integer; begin FileName:= 'C:\info\test.txt'; StringList:= TStringList.Create; StringList.CaseSensitive:= false; // pas de différence majuscule-minuscule try if FileExists(FileName) then StringList.LoadFromFile(FileName); for I:= 0 to ComboBox1.Items.Count - 1 do begin S:= ComboBox1.Items[I]; if StringList.IndexOf(S) < 0 then // l'item n'existe pas StringList.Add(S); end; StringList.SaveToFile(FileName); finally StringList.Free; end; end;