码迷,mamicode.com
首页 > 其他好文 > 详细

TQMsgPack序列还原clientdataset.data

时间:2015-03-12 11:05:39      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

序列

procedure TForm1.Button2Click(Sender: TObject);
var
msgpack: TQMsgPack;
begin
msgpack := TQMsgPack.Create;
try
msgpack.AsVariant := cds.Data;
if SaveDialog1.Execute then
begin
msgpack.SaveToFile(SaveDialog1.FileName);
end;
finally
FreeAndNil(msgpack);
end;
end;

还原

procedure TForm1.Button3Click(Sender: TObject);
var
msgpack: TQMsgPack;
begin
msgpack := TQMsgPack.Create;
try
if OpenDialog1.Execute() then
begin
msgpack.LoadFromFile(OpenDialog1.FileName);
cds.Close;
cds.Data := msgpack.AsVariant;
end;
finally
FreeAndNil(msgpack);
end;
end;

TQMsgPack序列还原clientdataset.data

标签:

原文地址:http://www.cnblogs.com/hnxxcxg/p/4331637.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!