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) 
                    {   } 

  • 相关阅读:
    以前给工大软件学院作得首页
    rinruby
    螃蟹为什么煮熟后会变红?
    关于R中利用apply、tapply、lapply、sapply、mapply、table
    hp laserjet 1020驱动 for windows
    关于睡觉巻起来姿势
    王强英語
    进程的前后台切换
    研究生=烟酒生
    计算矩阵乘法的网页工具
  • 原文地址:https://www.cnblogs.com/eebb/p/1166223.html
Copyright © 2011-2022 走看看