zoukankan      html  css  js  c++  java
  • xml StreamReader

    try 
                    { 
                            using   (StreamReader   sr   =   new   StreamReader(fileurl)) 
                            { 
                                    XmlDocument   doc   =   new   XmlDocument(); 
                                    doc.Load(sr); 
    }
                                    XmlNode   root   =   doc.DocumentElement; 
                                    XmlElement   elem1   =   doc.CreateElement("name"); 
                                    elem1.InnerText   =   uname; 
                                    XmlElement   elem2   =   doc.CreateElement("logtime"); 
                                    elem2.InnerText   =   time; 
                                    XmlNode   userelem   =   doc.CreateNode(XmlNodeType.Element,   "user",   ""); 
                                    userelem.AppendChild(elem1); 
                                    userelem.AppendChild(elem2); 
                                    root.AppendChild(userelem); 
                                    doc.Save(fileurl); 
                                    doc   =   null; 
                                   
                            
                    } 
                    catch   (Exception   ex) 
                    {   } 

  • 相关阅读:
    【html、CSS、javascript-9】jquery-选择器及过滤器
    【python之路40】Python 作用域
    H5缓存
    解决网络不可用--Using_Service_Workers
    跨域请求CORS
    基于node的websocket示例
    test
    函数节流
    ES6 promise
    web前端免费资源集
  • 原文地址:https://www.cnblogs.com/eebb/p/1166223.html
Copyright © 2011-2022 走看看