且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 VB.NET 中读取 XML 元素

更新时间:2023-11-24 14:10:58

如果您能够使用 Linq to XML,则可以使用 VB 的 XML 轴属性:

If you're able to use Linq to XML, you can use VB's XML Axis Properties:

Dim root As XElement = XDocument.Load(fileName).Root

Dim LocX = Integer.Parse(root.<Location>.<LocX>.Value)
Dim LocY = Integer.Parse(root.<Location>.<LocY>.Value)

root...Value = CStr(120) 也可以.