PDA

View Full Version : پیدا کردن مقداری در xml



iekrang
چهارشنبه 18 آبان 1384, 11:12 صبح
من توی xml تازه کارم.یه سوال دارم.
توی فایلی که گذاشتم چطوری باید مقدار domaincount را به دست بیاورم؟
ممنون میشم اگر راهنماییم کنید.

titbasoft
چهارشنبه 18 آبان 1384, 17:18 عصر
http://www.barnamenevis.org/forum/showthread.php?t=19364

Pouria.NET
چهارشنبه 29 شهریور 1385, 12:43 عصر
'Physical address of the xmlFile
Dim myFileAddress As String = String.Empty

'Name of the xml element
Dim NodeName As String = "domainCount"

Dim FS As New IO.FileStream(myFileAddress, IO.FileMode.Open)

Dim XR As New Xml.XmlTextReader(FS)

XR.MoveToContent()

'Raed till the reader reaches to the desired node
While XR.Read
If XR.NodeType = Xml.XmlNodeType.Element AndAlso XR.Name = NodeName Then
XR.Read()
MsgBox("The value of your xmlElement is:" & XR.Value, MsgBoxStyle.Information)
End If

End While
XR.Close()
FS.Close()