nishant ranjan

nishant ranjan

  • NA
  • 390
  • 0

textwriter

Apr 30 2013 2:56 AM
i have created a folder named xml. what i want to do is to create a test.xml file and write all data in stringbuilder sb to that test.xml file.
i am able to create the test.xml file at desired location but unable to write the value from sb to that file. below is my code


string filepath = Application.StartupPath;
            filepath = filepath.Replace("\\bin\\Debug", "\\xml\\");
         
            TextWriter tx = File.CreateText(filepath+"test.xml");
            tx.Write(sb.ToString());   // sb is stringbuilder whic contain data



Answers (3)