Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I turn a XML file into a xml string?
Message
From
15/02/2008 16:05:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/02/2008 11:15:22
General information
Forum:
ASP.NET
Category:
XML
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01292996
Message ID:
01293085
Views:
20
>Hi,
>
>How can I turn a XML file into a xml string.
>
>I have tried streamreader, xmltextreader, the output results only give me the text() part of xml file(all xml tags are not included).
>
>e.g. for a simple xml file:
>
>
>title1
>

>
>The output is only "title1", but I want the whole thing. Can anyone help as to how i get the whole file to be converted into a string unsing vb.net
>
>Thanks for the help in advance.
>
>Bilal.
using System;
using System.IO;

class test
{
  static void Main()
  {
     TextReader rdr = new StreamReader(@"C:\myPath\myxmlfile.xml");
      string content = rdr.ReadToEnd();
      rdr.Close();
      Console.WriteLine(content);
  }
}
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform