1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問(wèn)題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
      Linq中怎么創(chuàng)建一個(gè)xml文檔概述

      Linq中怎么創(chuàng)建一個(gè)xml文檔概述,針對(duì)這個(gè)問(wèn)題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問(wèn)題的小伙伴找到更簡(jiǎn)單易行的方法。

      站在用戶的角度思考問(wèn)題,與客戶深入溝通,找到儀征網(wǎng)站設(shè)計(jì)與儀征網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站制作、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、主機(jī)域名網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋儀征地區(qū)。

      Linq創(chuàng)建xml文檔

      XElement contacts =  new XElement("Contacts",  new XElement("Contact",  new XElement("Name", "Patrick Hines"),  new XElement("Phone", "206-555-0144",  new XAttribute("Type", "Home")),  new XElement("phone", "425-555-0145",  new XAttribute("Type", "Work")),  new XElement("Address",  new XElement("Street1", "123 Main St"),  new XElement("City", "Mercer Island"),  new XElement("State", "WA"),  new XElement("Postal", "68042")  )  )  );

      XElement構(gòu)造函數(shù)接受兩個(gè)參數(shù),節(jié)點(diǎn)名和Content,Content可以是簡(jiǎn)單字符串,也可以的屬性和子節(jié)點(diǎn)集合。

      創(chuàng)建帶命名空間的xml文檔

      XNamespace myns = "http://www.cnblogs.com/mshijie";   XElement root = new XElement(myns + "pets",  new XAttribute(XNamespace.Xmlns + "myns", myns),  new XElement(myns + "pet",  new XElement(myns + "name", "Dog")));  root.Save("test.xml");

      test.xml

         Dog  

      查詢

      XNamespace myns = "http://www.cnblogs.com/mshijie";  XElement pets = XElement.Load("test.xml");   var query = from pet in pets.Elements(myns + "pet")  select pet;   Array.ForEach(query.ToArray(), p => Console.WriteLine(p.Element(myns + "name").Value));

      關(guān)于Linq中怎么創(chuàng)建一個(gè)xml文檔概述問(wèn)題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒(méi)有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識(shí)。


      網(wǎng)站名稱:Linq中怎么創(chuàng)建一個(gè)xml文檔概述
      新聞來(lái)源:http://www.ef60e0e.cn/article/gppcgh.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        平罗县| 商水县| 晴隆县| 通江县| 海口市| 孟津县| 饶阳县| 浮山县| 泰安市| 崇义县| 修水县| 河池市| 南和县| 吴堡县| 安岳县| 宣武区| 镇康县| 鄯善县| 灌阳县| 乐清市| 河西区| 林口县| 阳江市| 北碚区| 井研县| 邢台市| 浮梁县| 菏泽市| 江西省| 沂源县| 剑阁县| 大渡口区| 中西区| 陆川县| 托里县| 芦溪县| 林西县| 湖州市| 祁连县| 长泰县| 宁晋县|