91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 38KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-14
  • 語言: C#
  • 標(biāo)簽:

資源簡介

wince下的C#讀取xml文件,wince智能項目不支持相對路徑,所以沒有Setting.setting配置文件,所以需要讀寫xml,下載文件中有詳細(xì)說明

資源截圖

代碼片段和文件信息

using?System;
using?System.Linq;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.xml;

namespace?SmartDevicexmlTest
{
????public?partial?class?Form1?:?Form
????{
????????string?filename?=?““;
????????
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?btWrite_Click(object?sender?EventArgs?e)
????????{
????????????
????????????xmlDocument?xmlDoc?=?new?xmlDocument();??

????????????xmlDoc.Load(filename);??
????????????//xmlDoc.Loadxml(““);??
????????????xmlNode?root?=?xmlDoc.SelectSingleNode(“bookstore“);//查找??
????????????xmlElement?xe1?=?xmlDoc.CreateElement(“book“);//創(chuàng)建一個節(jié)點??
????????????xe1.SetAttribute(“genre“?“李贊紅“);//設(shè)置該節(jié)點genre屬性??
????????????xe1.SetAttribute(“ISBN“?“2-3631-4“);//設(shè)置該節(jié)點ISBN屬性??
???
????????????xmlElement?xesub1?=?xmlDoc.CreateElement(“title“);??
????????????xesub1.InnerText?=?“CS從入門到精通“;//設(shè)置文本節(jié)點??
????????????xe1.AppendChild(xesub1);//添加到節(jié)點中??

????????????xmlElement?xesub2?=?xmlDoc.CreateElement(“author“);??
????????????xesub2.InnerText?=?“候捷“;??
????????????xe1.AppendChild(xesub2);??
????????????xmlElement?xesub3?=?xmlDoc.CreateElement(“price“);??
????????????xesub3.InnerText?=?“58.3“;??
????????????xe1.AppendChild(xesub3);??
???
????????????root.AppendChild(xe1);//添加到節(jié)點中??
????????????xmlDoc.Save(filename);

????????????//插入完成后讀取信息
????????????//ShowAllInfo(filename?xmlDoc);
????????}

????????private?void?btRead_Click(object?sender?EventArgs?e)
????????{

????????????xmlDocument?xmlDoc?=?new?xmlDocument();

????????????xmlDoc.Load(filename);?

????????????ShowAllInfo(filename?xmlDoc);

????????????//修改完成后讀取信息
????????}

????????private?void?ShowAllInfo(string?tmpfilename?xmlDocument?tmpxmlDoc)
????????{

????????????????textBox1.Text?=?““;

????????????????//xmlNode?xn?=?tmpxmlDoc.SelectSingleNode(“bookstore“);??
??????
????????????????//xmlNodeList?xnl?=?xn.ChildNodes;
????????????????xmlNodeList?xnl?=?tmpxmlDoc.SelectSingleNode(“bookstore“).ChildNodes;
???????????????

????????????????foreach?(xmlNode?xnf?in?xnl)
????????????????{
????????????????????xmlElement?xe?=?(xmlElement)xnf;
????????????????????//Console.WriteLine(xe.GetAttribute(“genre“));//顯示屬性值??
????????????????????//Console.WriteLine(xe.GetAttribute(“ISBN“));
????????????????????textBox1.Text?+=?xe.GetAttribute(“genre“)?+?“\r\n“;
????????????????????textBox1.Text?+=?xe.GetAttribute(“ISBN“)?+?“\r\n“;

????????????????????xmlNodeList?xnf1?=?xe.ChildNodes;

????????????????????foreach?(xmlNode?xn2?in?xnf1)
????????????????????{
????????????????????????//Console.WriteLine(xn2.InnerText);//顯示子節(jié)點點文本??
????????????????????????textBox1.Text?+=?xn2.InnerText+“\r\n“;
????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????516??2009-09-18?09:52??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\bin\Debug\Config.xml

?????文件??????10240??2011-12-22?15:04??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\bin\Debug\SmartDevicexmlTest.exe

?????文件??????28160??2011-12-22?15:04??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\bin\Debug\SmartDevicexmlTest.pdb

?????文件????????219??2009-09-18?09:36??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Config.xml

?????文件???????5780??2011-12-22?15:04??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Form1.cs

?????文件???????4398??2009-09-18?13:25??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Form1.Designer.cs

?????文件???????6101??2009-09-18?13:25??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Form1.resx

?????文件???????1882??2011-12-22?14:30??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\SmartDevicexmlTest.csproj.FileListAbsolute.txt

?????文件????????847??2009-09-18?13:30??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\SmartDevicexmlTest.csproj.GenerateResource.Cache

?????文件??????10240??2011-12-22?15:04??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\SmartDevicexmlTest.exe

?????文件????????180??2011-12-22?14:32??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\SmartDevicexmlTest.Form1.resources

?????文件??????28160??2011-12-22?15:04??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\SmartDevicexmlTest.pdb

?????文件????????180??2011-12-22?14:32??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\SmartDevicexmlTest.Properties.Resources.resources

?????文件????????383??2009-09-18?09:27??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Program.cs

?????文件???????1453??2009-09-18?09:27??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Properties\AssemblyInfo.cs

?????文件???????2373??2009-09-18?09:27??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Properties\Resources.Designer.cs

?????文件???????5618??2009-09-18?09:27??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Properties\Resources.resx

?????文件???????4202??2009-09-18?09:36??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest.csproj

?????文件????????198??2011-12-22?14:32??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest.csproj.user

?????文件???????1110??2009-09-18?09:27??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest.sln

????..A..H.?????17920??2011-12-22?15:19??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest.suo

?????文件?????????55??2011-12-22?15:20??wince?C#?讀寫xml\說明.txt

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\Refactor

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug\TempPE

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\bin\Debug

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj\Debug

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\bin

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\obj

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest\Properties

?????目錄??????????0??2011-12-27?11:41??wince?C#?讀寫xml\SmartDevicexmlTest\SmartDevicexmlTest\SmartDevicexmlTest

............此處省略6個文件信息

評論

共有 條評論

相關(guān)資源