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. C#
  4. text files

text files

Scheduled Pinned Locked Moved C#
questiondata-structureshelplearning
2 Posts 2 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.
  • R Offline
    R Offline
    rcwoods
    wrote on last edited by
    #1

    Hi Im a beginner and need some help How do i write to a text file that already has data in it. I basically want to insert the values i put in my textboxes as a new record in my txtfile. It must not create a new file or delete the existing records. Also, i know i should put all the textbox values into an array, but how do i write this array seperated by commas to my txtfile? ie. textfile looks like this: John,15,motorbike,20,12 Luke,12,car,24,11 Please could someone help me out

    G 1 Reply Last reply
    0
    • R rcwoods

      Hi Im a beginner and need some help How do i write to a text file that already has data in it. I basically want to insert the values i put in my textboxes as a new record in my txtfile. It must not create a new file or delete the existing records. Also, i know i should put all the textbox values into an array, but how do i write this array seperated by commas to my txtfile? ie. textfile looks like this: John,15,motorbike,20,12 Luke,12,car,24,11 Please could someone help me out

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Use the System.IO.File.AppendText method to open the file for appending. You can use the string.Join method to join the values in an array into a single string. --- b { font-weight: normal; }

      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