Click here to Skip to main content
15,662,434 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an xml file named "sysparam.xml" contain:


i want a class in that return the inner text of the node as a string where the method should look like :

 Function GetParamValue(ByVal oKey As String) As String
end function

Any Help Please
Richard C Bishop 2-Oct-13 11:12am    
Help with what? Read the file and assign the text to a string object.
ZurdoDev 2-Oct-13 11:12am    
Use the XDocument class or the XmlDocument class.
[no name] 2-Oct-13 11:21am    
its my first time i use the xml so i dont know how to use it
ZurdoDev 2-Oct-13 11:37am    
Google for those classes and there will be examples on how to use them.

1 solution

As .NET FCL provides different ways for parsing and generating XML, you have to pick up what will suit you the most. This is my short overview:

  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
  2. Use the classes System.Xml.XmlTextWriter and System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.

Good luck,
Share this answer
Abhinav Gauniyal 2-Oct-13 14:41pm    
Lot of XML queries these days :) , for more info : see here
Sergey Alexandrovich Kryukov 2-Oct-13 16:08pm    
This is the same thing, I put the same answer...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900