zoukankan      html  css  js  c++  java
  • delphi 一个关于xml文件导入数据库的问题

    function LoadXml(shortPath:string;var xmlobj: IXMLDOMDocument):boolean;
    
    var tmpXml:IXMLDOMDOCUMENT;
    
    begin
    
       shortPath:=localPath+shortPath;
    
       if not FileExists(shortPath) then
    
         begin
    
          LoadXml:=false;
    
          exit;
    
         end;
    
       tmpxml := CreateOLEObject('Microsoft.XmlDom') as IXMLDOMDocument;
    
       tmpxml.async := false;
    
       tmpxml.load(shortPath);
    
       if tmpxml.parseError.errorCode <> 0 then
    
         begin
    
           LoadXml:=false;
    
           Exit;
    
         end;
    
       xmlobj:=tmpxml;
    
       tmpxml:=nil;
    
       Loadxml:=true;
    
    end;
    
    
    
    procedure InitNetInfo(var theNet:netInfoType);
    
    var objxml:IxmlDomdocument;
    
        Node1:IxmlDomNode;
    
    begin
    
    if not Loadxml(iniFile,objXml) then exit;
    
    Node1:=objXml.selectSingleNode('//DefaultIP');
    
    if Node1<>nil then theNet.Csdn_IP:=Node1.text;
    
    Node1:=objXml.selectSingleNode('//DefaultPath');
    
    if Node1<>nil then theNet.Csdn_Path:=Node1.text;
    
    Node1:=objXml.selectSingleNode('//UseProxy');
    
    if Node1<>nil then theNet.flg_UseProxy:=StrtoBool(Node1.text);
    
    Node1:=objXml.selectSingleNode('//ProxyIP');
    
    if Node1<>nil then theNet.prx_IP:=Node1.text;
    
    Node1:=objXml.selectSingleNode('//ProxyPort');
    
    if Node1<>nil then theNet.prx_Port:=Node1.text;
    
    Node1:=objXml.selectSingleNode('//ProxyUser');
    
    if Node1<>nil then theNet.prx_User:=Node1.text;
    
    Node1:=objXml.selectSingleNode('//ProxyPass');
    
    if Node1<>nil then theNet.prx_Pass:=Node1.text;
    
    //其他信息
    
    Node1:=objXml.selectSingleNode('//HeadSize');
    
    if Node1<>nil then HeadSize:=strtoint(Node1.text);
    
    Node1:=objXml.selectSingleNode('//TopicSize');
    
    if Node1<>nil then TopicSize:=strtoint(Node1.text);
    
    objxml:=nil;
    
    Node1:=nil;
    
    end;
  • 相关阅读:
    MATLAB批量打印输出600PPI的图像且图像不留空白
    IC设计基础
    深度学习及图像处理学习路线(一)
    IC设计学习路线
    图像处理算法的仿真平台之VGA时序
    数字IC笔试题芯源
    C++图像处理算法入门前言
    爱因斯坦我的信仰
    linux 设置定时任务执行清理日志脚本
    SpringMVC的工作原理(执行流程)
  • 原文地址:https://www.cnblogs.com/blogpro/p/11339116.html
Copyright © 2011-2022 走看看