Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. replacing text in a text file on server...

replacing text in a text file on server...

Scheduled Pinned Locked Moved ASP.NET
questionsysadminhelp
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rashadaliarshad
    wrote on last edited by
    #1

    hello friends... i m facing problems, while appending a file with (.txt) extention on server. I have a textarea on in a web page, user types some text and clicks save button. and the text in textarea must be replaced with the text in file on server named ( lets say mytextfile.txt). i dont know any hint of how can i achieve this task... any help?

    :- Rashid Ali -:

    S T 2 Replies Last reply
    0
    • R rashadaliarshad

      hello friends... i m facing problems, while appending a file with (.txt) extention on server. I have a textarea on in a web page, user types some text and clicks save button. and the text in textarea must be replaced with the text in file on server named ( lets say mytextfile.txt). i dont know any hint of how can i achieve this task... any help?

      :- Rashid Ali -:

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Its better to search on google first then ask if you didn't find anything Google is your best friend :) Let it be Use TextWriter to write into text file use streamWriter class to open the file in the constructor of the streanWriter pass 2 parameters path and bool true or false to append the text to file like this TextWriter textwriter = new StreamWriter("Path of mytextfile.txt", true); textwriter.WriteLine(TextArea.Text.ToString()): textwriter.Close();

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      1 Reply Last reply
      0
      • R rashadaliarshad

        hello friends... i m facing problems, while appending a file with (.txt) extention on server. I have a textarea on in a web page, user types some text and clicks save button. and the text in textarea must be replaced with the text in file on server named ( lets say mytextfile.txt). i dont know any hint of how can i achieve this task... any help?

        :- Rashid Ali -:

        T Offline
        T Offline
        Tarik Guney
        wrote on last edited by
        #3

        StreamWriter write = File.AppendText("path"); write.Write("blah blah"); Hope it helps...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups