这个是个用TWriter TReader播放列表的例子 Tnt 是 TntControls那套控件 当作没有就行了
Procedure TForm1.AMPListSave();
Var i:Integer;
FS:TFileStream;
Writer:TWriter;
Begin
If Form1.TntSaveDialog1.Execute then Begin
FS:=TFileStream.Create(Form1.TntSaveDialog1.FileName,fmCreate);
Writer:=TWriter.Create(FS,4096);
Writer.WriteInteger(AMPListCount);
For i:=0 to AMPListCount-1 do Writer.WriteWideString(AMPListArray.ArrayStr);
Writer.Free;
FS.Free;
End;
End;
Procedure TForm1.AMPListLoad();
Var i:Integer;
FS:TFileStream;
Reader:TReader;
Begin
If Form1.TntOpenDialog2.Execute then Begin
FS:=TFileStream.Create(Form1.TntOpenDialog2.FileName,fmOpenRead);
Reader:=TReader.Create(FS,4096);
AMPListCount:=Reader.ReadInteger;
FillChar(AMPListArray,SizeOf(AMPListArray),0);
SetLength(AMPListArray,AMPListCount+1);
For i:=0 to AMPListCount-1 do AMPListArray.ArrayStr:=Reader.ReadWideString;
Reader.Free;
FS.Free;
Form1.AMPListRefresh;
End;
End;