[.NET] 如何利用XmlDocument建立空值的Element?

看板Visual_Basic作者 (中中)時間8年前 (2016/01/14 21:28), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
請輸入專案類型(網站專案或者應用程式專案):應用程式 想請教各位, 最近在寫xml文件遇到個問題 Dim xdoc as xmlDocument Dim xElement as xmlElement xdoc = new xmlDocument xElement = xdoc.CreateElement("TEST") xdoc.AppendChild(xElement) 這樣似乎會有問題, 想問如何建立只有Element而沒有值的標籤呢?如 <TEST></TEST> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 106.1.127.109 ※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1452778131.A.6A6.html

01/19 17:24, , 1F
xElement.innerText = ""
01/19 17:24, 1F

01/19 17:25, , 2F
猜的 沒試過... 不行就用innerXml看看
01/19 17:25, 2F
文章代碼(AID): #1MbwAJQc (Visual_Basic)