• 大小: 0.06M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: 写Xml  Xml  读写  文件  

资源简介

读写xml文件

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using System.xml;


namespace xmlread
{
    public partial class Form1 : Form
    {
        xmlDocument doc;

        public Form1()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender EventArgs e)
        {
            doc = new xmlDocument();
            xmlReaderSettings settings = new xmlReaderSettings();
            settings.IgnoreComments = true;
            string filepath = Environment.CurrentDirectory;
            filepath += “\\book.xml“;

            xmlReader reader = xmlReader.Cr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-05-11 14:11  xmlread\
     目录           0  2019-05-11 14:11  xmlread\xmlread\
     文件         187  2019-05-08 22:12  xmlread\xmlread\App.config
     文件        7399  2019-05-12 09:03  xmlread\xmlread\Form1.Designer.cs
     文件        4025  2019-05-12 09:03  xmlread\xmlread\Form1.cs
     文件        5817  2019-05-12 09:03  xmlread\xmlread\Form1.resx
     文件         519  2019-05-08 22:12  xmlread\xmlread\Program.cs
     目录           0  2019-05-11 14:11  xmlread\xmlread\Properties\
     文件        1334  2019-05-08 22:12  xmlread\xmlread\Properties\AssemblyInfo.cs
     文件        2866  2019-05-08 22:12  xmlread\xmlread\Properties\Resources.Designer.cs
     文件        5612  2019-05-08 22:12  xmlread\xmlread\Properties\Resources.resx
     文件        1094  2019-05-08 22:12  xmlread\xmlread\Properties\Settings.Designer.cs
     文件         249  2019-05-08 22:12  xmlread\xmlread\Properties\Settings.settings
     目录           0  2019-05-11 14:11  xmlread\xmlread\bin\
     目录           0  2019-05-11 14:11  xmlread\xmlread\bin\Debug\
     文件        1041  2019-05-09 00:12  xmlread\xmlread\bin\Debug\book.xml
     文件       13312  2019-07-05 15:45  xmlread\xmlread\bin\Debug\xmlread.exe
     文件         187  2019-05-08 22:12  xmlread\xmlread\bin\Debug\xmlread.exe.config
     文件       34304  2019-07-05 15:45  xmlread\xmlread\bin\Debug\xmlread.pdb
     文件       22984  2019-07-05 15:48  xmlread\xmlread\bin\Debug\xmlread.vshost.exe
     文件         187  2019-05-08 22:12  xmlread\xmlread\bin\Debug\xmlread.vshost.exe.config
     文件         490  2019-03-19 12:46  xmlread\xmlread\bin\Debug\xmlread.vshost.exe.manifest
     文件        1169  2019-05-08 22:10  xmlread\xmlread\bin\book.xml
     文件        1169  2019-05-08 22:10  xmlread\xmlread\book.xml
     目录           0  2019-05-11 14:11  xmlread\xmlread\obj\
     目录           0  2019-07-05 15:45  xmlread\xmlread\obj\Debug\
     文件        1308  2019-07-05 15:45  xmlread\xmlread\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6919  2019-05-11 14:11  xmlread\xmlread\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2019-07-05 15:49  xmlread\xmlread\obj\Debug\TempPE\
     文件           0  2019-05-08 22:12  xmlread\xmlread\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2019-05-08 22:12  xmlread\xmlread\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
............此处省略12个文件信息

评论

共有 条评论