Delphi 向XML中添加对象.rar

时间:2022-07-30 06:25:43
【文件属性】:
文件名称:Delphi 向XML中添加对象.rar
文件大小:8KB
文件格式:RAR
更新时间:2022-07-30 06:25:43
Delphi源码-文件操作 Delphi 向XML中添加对象,演示创建一个XML对象 ,然后向各个XML内容节点中添加内容,比如下面的代码:   XMLDocument1.Active := False;   XMLDocument1.XML.Text := '';   XMLDocument1.Active := True;   XMLDocument1.Encoding:='GB2312';//设置字符集   iXml := XMLDocument1.DOMDocument;   iRoot := iXml.appendChild (    iXml.createElement ('Button1'));   AddAttr (iRoot, 'Name', Button1.Name);   AddAttr (iRoot, 'Caption', Button1.Caption);   AddAttr (iRoot, 'Font.Name', Button1.Font.Name);   AddAttr (iRoot, 'Left', IntToStr (Button1.Left));   AddAttr (iRoot, 'Hint', Button1.Hint);   Memo1.Lines.Text := XMLDocument1.XML.Text;   完整代码请下载本源码包。
【文件预览】:
codesc.net
----向XML中添加对象()
--------Project1.res(876B)
--------Unit1.dfm(1KB)
--------Unit1.ddp(51B)
--------Project1.cfg(434B)
--------Unit1.pas(2KB)
--------Project1.dpr(192B)
--------Project1.dof(3KB)
--------Unit1.dcu(6KB)

网友评论