save textbox value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siddhanta
    New Member
    • Oct 2009
    • 33

    save textbox value

    hi,
    i wanna save the textbox values in notepad(.txt). can u plz guide me how to proceed
  • relikangus
    New Member
    • Nov 2009
    • 3

    #2
    you mean you wanna save the text that is in the text-box into a (.txt) file that may be opened in notepad?

    Comment

    • siddhanta
      New Member
      • Oct 2009
      • 33

      #3
      yup exactly
      there are 4 textboxes. and i want to save the values of all textbox in a single notepad.

      Comment

      • relikangus
        New Member
        • Nov 2009
        • 3

        #4
        ok

        1. make sure you add the using System.IO in the directives at the top. you need that to do reading/writing to files on the systm

        String theData = textbox1.Text;

        FileStream aFile = new FileStream("myT extFile.txt", FileMode.OpenOR Create);
        StreamWriter sw = new StreamWriter(aF ile);
        sw.WriteLine(th eData);
        sw.close();


        i'm assuming that the text box is called textbox1
        Last edited by relikangus; Nov 1 '09, 07:45 PM. Reason: clarifiation

        Comment

        Working...