起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 256|回复: 1

(load)读xml文件[分享]**

[复制链接]
发表于 2008-3-7 18:08:07 | 显示全部楼层 |阅读模式
unit MainForm;

interface

uses
  Business.System, Business.Forms,Business.Model, Borland.Delphi.msxml;

type
  TMainForm = class(TForm)
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    procedure Button1Click(Sender: TObject);
  private
    {private declarations}
  public
    {public declarations}
  end;

implementation


procedure TMainForm.Button1Click(Sender: TObject);
var
   Data: IXMLDOMDocument;
    lNode: IXMLDOMNode;
begin
     if   OpenDialog1.Execute then
     begin
          Data := ComObj.CreateOleObject('Microsoft.XMLDOM') as IXMLDOMDocument;
         if not data.load(OpenDialog1.FileName) then
         begin
            dialogs.ShowMessage('装载失败!');
         end
         else begin
          dialogs.ShowMessage(data.documentElement.getElementsByTagName('Develop').item[0].childNodes[1].Get_attributes.getNamedItem('UserID').text);
         end;
     end;
end;

end.
回复

使用道具 举报

 楼主| 发表于 2008-3-7 18:09:52 | 显示全部楼层
温馨提示:
用我们建模工具目录里的config.xml测试哦!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-8 03:20 , Processed in 0.044244 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表