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
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB EE Read/Write to a text file

VB EE Read/Write to a text file

Scheduled Pinned Locked Moved Visual Basic
question
5 Posts 3 Posters 0 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.
  • N Offline
    N Offline
    newtwales
    wrote on last edited by
    #1

    :)Hi How do you write the content of a text box to a file, appending new content and reading back that file into the text box showing the last written content at the top of the file? Many thanks for any assistence. newtWales

    I B 2 Replies Last reply
    0
    • N newtwales

      :)Hi How do you write the content of a text box to a file, appending new content and reading back that file into the text box showing the last written content at the top of the file? Many thanks for any assistence. newtWales

      I Offline
      I Offline
      isroavi
      wrote on last edited by
      #2

      Dim reader As New IO.StreamReader(Server.MapPath("MyTextfile.txt")) Textbox.text = reader.ReadToEnd() same like write also raj

      N 1 Reply Last reply
      0
      • N newtwales

        :)Hi How do you write the content of a text box to a file, appending new content and reading back that file into the text box showing the last written content at the top of the file? Many thanks for any assistence. newtWales

        B Offline
        B Offline
        Bhanwar Gupta
        wrote on last edited by
        #3

        hai you can try this out......... dim a as string a=textbox1.text File.AppendAllText("g:\text.text", a) File.AppendAllText("g:\text.text", Now.Date) File.AppendAllText("g:\text.text", " ) File.AppendAllText("g:\text.text", Now.DayOfWeek.ToString) plz reply if this solve your problem

        N 1 Reply Last reply
        0
        • B Bhanwar Gupta

          hai you can try this out......... dim a as string a=textbox1.text File.AppendAllText("g:\text.text", a) File.AppendAllText("g:\text.text", Now.Date) File.AppendAllText("g:\text.text", " ) File.AppendAllText("g:\text.text", Now.DayOfWeek.ToString) plz reply if this solve your problem

          N Offline
          N Offline
          newtwales
          wrote on last edited by
          #4

          Sorry but I could not get this to work, but thank anyway. I got an error mesg saying " .AppendAllText" is not a member of Text. And I could not find a workaround. :)Jim

          1 Reply Last reply
          0
          • I isroavi

            Dim reader As New IO.StreamReader(Server.MapPath("MyTextfile.txt")) Textbox.text = reader.ReadToEnd() same like write also raj

            N Offline
            N Offline
            newtwales
            wrote on last edited by
            #5

            Hi Raj Many thanks for this it works well...Jim

            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