Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I am reading a Xml file from folder how can get all xml content as string using c#,

i have googled but i got only to read the names of the file.
Posted
Comments
[no name] 12-Oct-15 5:22am    
As mentioned by KrunalRohit below, you can able to get the content from a file as string. you can use any xmlDocument to load the xml and whenever you need the content as string you can use the child methods.

C#
string content = File.ReadAllText(@"path-to-file.xml");

This should do.

-KR
 
Share this answer
 
Comments
CPallini 12-Oct-15 5:33am    
5.
this isnt quite 'all' you asked for but it's a start https://msdn.microsoft.com/en-us/library/s2tte0y1(v=vs.110).aspx[^]

from there you could do a String.Join to achieve the result
 
Share this 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