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 store data(images, Text, Music) in one file? like.dat

How to store data(images, Text, Music) in one file? like.dat

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
7 Posts 6 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
    Abed AlSayed
    wrote on last edited by
    #1

    Hi I want to know how to store data in one file with my own extention. sorry I have no code because I'am a looooooooser :sigh: so pleaaaasee help me with a project sample and pleeeaaase let me know how would my program reads these files to use them. how :((

    R L E L 4 Replies Last reply
    0
    • A Abed AlSayed

      Hi I want to know how to store data in one file with my own extention. sorry I have no code because I'am a looooooooser :sigh: so pleaaaasee help me with a project sample and pleeeaaase let me know how would my program reads these files to use them. how :((

      R Offline
      R Offline
      riced
      wrote on last edited by
      #2

      Try here: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/6fb159cb-b195-409b-b8ad-702e457b0692[^] :-D

      Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

      A 1 Reply Last reply
      0
      • R riced

        Try here: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/6fb159cb-b195-409b-b8ad-702e457b0692[^] :-D

        Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

        A Offline
        A Offline
        Abed AlSayed
        wrote on last edited by
        #3

        This is my thread in msdn forms and nothing helps there...

        B 1 Reply Last reply
        0
        • A Abed AlSayed

          Hi I want to know how to store data in one file with my own extention. sorry I have no code because I'am a looooooooser :sigh: so pleaaaasee help me with a project sample and pleeeaaase let me know how would my program reads these files to use them. how :((

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Alsayed web wrote:

          sorry I have no code because I'am a looooooooser :sigh:

          That's no way to introduce yourself. You got the same type of brain that I have, and you probably run on water and sunlight like the rest of us. Use a database (like SQL CE or SQLite), encrypt the contents and rename the extension to ".dat". Use a folder, zip it and rename the zipfile to ".dat". Use an Xml file, and store the other files in Base64-encoding, and rename it to ".dat". Let's start simple; can you post the code here to write the line "Hello world" to a file? If not, that's where to start :)

          Bastard Programmer from Hell :suss:

          1 Reply Last reply
          0
          • A Abed AlSayed

            Hi I want to know how to store data in one file with my own extention. sorry I have no code because I'am a looooooooser :sigh: so pleaaaasee help me with a project sample and pleeeaaase let me know how would my program reads these files to use them. how :((

            E Offline
            E Offline
            enhzflep
            wrote on last edited by
            #5

            These select quotes from the thread of yours @ MSDN says it all:

            Alsayed web wrote:

            and please don't say what should I do, just give me a link or a code

            Cor Ligthert (MVP) wrote:

            Why don't you simple say, don't say what should I do, just make and sell it for me and give me the money.

            Riced(FWSR) wrote:

            It's not a duplicate(thread) but a triplicate(thread). Also posted on CodeProject because he cannot get an answer here. LOL Quote from CodeProject reply when I pointed him here: "This is my thread in msdn forms and nothing helps there..." :)

            1 Reply Last reply
            0
            • A Abed AlSayed

              This is my thread in msdn forms and nothing helps there...

              B Offline
              B Offline
              Bernhard Hiller
              wrote on last edited by
              #6

              "Use a zip file and change the extension" That does not help you? That is quite a common way nowadays. Ever tried it the other way round, with say a .docx? Do that! Rename a Word document to a zip file, and unzip it!

              1 Reply Last reply
              0
              • A Abed AlSayed

                Hi I want to know how to store data in one file with my own extention. sorry I have no code because I'am a looooooooser :sigh: so pleaaaasee help me with a project sample and pleeeaaase let me know how would my program reads these files to use them. how :((

                L Offline
                L Offline
                LCARS x32
                wrote on last edited by
                #7

                If you want to do it through your own code, use a FileStream to read the files into memory and another to write them to the same file. FileStreams read the raw bytes of the files. You'll want to put some sort of delimiter between the files so you can separate them later. To add your delimiter to the file, create a string and then use System.Text.Encoding.Ascii.GetBytes(YourStringVariable). That will give you a byte array with which to write with the filestream's write method. Hope that wasn't too confusing! Ray PS: If you want to compress your files, there are lots of examples for compressing files in .NET, just search google for "compression vb.net"

                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