Feeds:
Posts
Comments

Archive for October, 2010

            string path = @"c:\samplefile.txt";
            StreamReader streamReader = new StreamReader(path);
            string line=streamReader.ReadLine();
            while ( line!= null)
            {
                Console.WriteLine(line);
                line = streamReader.ReadLine();
            }
            Console.ReadLine();

Read Full Post »

Loading XML Document from a file.

XmlDocument doc = new XmlDocument();
doc.Load(@"C:\samplexmlfile.xml");

Loading XML Document from string

string fileContent ="<Root><SomeNode>SomeValue</SomeNode></Root>";
XmlDocument doc = new XmlDocument();
TextReader rdr = new StringReader(fileContent);
doc.Load(rdr);

Hope this help!

Read Full Post »

%d bloggers like this: