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. How to write data into a file?

How to write data into a file?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
3 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.
  • A Offline
    A Offline
    ashwath1979
    wrote on last edited by
    #1

    Hi all, Can anybody please send me the code of how to write into a file. Thank you.

    D N 2 Replies Last reply
    0
    • A ashwath1979

      Hi all, Can anybody please send me the code of how to write into a file. Thank you.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      How about something a little more usefull[^].

      Dave Kreskowiak Microsoft MVP - Visual Basic

      1 Reply Last reply
      0
      • A ashwath1979

        Hi all, Can anybody please send me the code of how to write into a file. Thank you.

        N Offline
        N Offline
        Nouvand
        wrote on last edited by
        #3

        Lets say you wanna write data into binary file. Make sure you already convert the data into byte array (in this examples: StreamByte()). And if you;re using vb 2005, use this a line code to write to file. My.Computer.FileSystem.WriteAllBytes("C:\MyData.dat", StreamByte, True) Set the last argument to False if you want to append the file. It means, you can add more bytes chain into the same file. And if you wanna read your data, use this one Dim StreamByte As Byte() = My.Computer.FileSystem.ReadAllBytes("C:\MyData.dat") hope this helpful.

        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