unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
const
  FilePath = 'c:\temp\Test.txt';
var
  List: TStringList;
begin
  List := TStringList.Create;
  List.Sorted := True;
  List.Duplicates := dupIgnore;
  List.LoadFromFile(FilePath);
  ListBox1.Items.Assign(List);
  List.Free;
end;

end.

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-07-14
  • 2021-12-25
  • 2022-01-20
  • 2022-01-16
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2022-02-22
  • 2022-02-11
  • 2021-09-12
  • 2022-12-23
相关资源
相似解决方案