COMM/XmlProcess.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Data;
using System.Xml;

namespace COMM
{
    public class XmlProcess
    {
        public DataTable ReadXml(string filePath, string id, string name)
        {
            //string a = "222443<BR>er";
            //a = a.Replace(Char(13)+Char(10),"<BR>");
            DataTable dt = new DataTable();
            dt.Columns.Add(id, typeof(int));
            dt.Columns.Add(name, typeof(string));
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load(filePath);
            foreach (XmlNode node in xdoc.DocumentElement.ChildNodes)
            {
                if (node.NodeType == XmlNodeType.Element)
                {
                    //dt[0] = node.Attributes[0].Value;
                    //dt[1] = node.Attributes[1].Value;
                }
            }
            return dt;
        }

        public DataSet ReadXml_DS(string filePath)
        {
            DataSet ds = new DataSet();
            ds.ReadXml(filePath);
            return ds;
            //if (lanDS.Tables.Count > 0)
            //{

            //    foreach (DataRow copyRow in lanDS.Tables[0].Rows)
            //    {

            //        dt.ImportRow(copyRow);

            //    }

            //}
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。