<?xml version="1.0" encoding="utf-8"?>
<users>
<user>
<name>aditi</name>
<password>A802CEDA2B04377E3265FC30C3D7CE9F4FADBEA0</password>
<firstname>aditi</firstname>
<lastname>surname</lastname>
<usertype>1</usertype>
</user>
<user>
<name>jillian</name>
<password>A802CEDA2B04377E3265FC30C3D7CE9F4FADBEA0</password>
<firstname>jillian</firstname>
<lastname>chen</lastname>
<usertype>2</usertype>
</user>
</users>
How can I search for the <name> and the <password> node so that I can authenticate the login using this XML in ASP.NET?
Currently I am looking at something like this -
Dim strXMLDoc As String = Left(System.Web.HttpContext.Current.Session("strCurrPath"), InStrRev(System.Web.HttpContext.Current.Session("strCurrPath"), "\")) & "WEContent" & "\users.xml"
Dim objXMLDoc As New XmlDocument()
lblErrorMessage.Text = ""
Try
'Load the XML document
objXMLDoc.Load(strXMLDoc)
Catch ex As Exception
lblErrorMessage.Text = ex.Message & "<br />" & ex.Source
End Try
Dim xmlNodeUser As XmlNode = objXMLDoc.SelectSingleNode("/user")
dim xmlNodePass As XmlNode = objXMLDoc.SelectSingleNode("/password")
But I am completely confused as to how I am going to authenticate the usernames and passwords from an XML file.
Help is urgently needed. :S
Thanks,
Aditi