Something other than .txt's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • toefraz
    New Member
    • Nov 2007
    • 19

    Something other than .txt's

    Hey, guys. I'm working on a quote generating program that displays a random quote from a text file. I was just wondering if there was anyway to put that textfile inside of the .exe or make the txt file into something non-edittable. I'm new at this so I don't know all of my options. I would just like a little nudge in the right direction.

    Any help would be appreciated. Thanks
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    I was just wondering if there was anyway to put that textfile inside of the .exe
    Like making it a resource? Look up resource scripts and resource script files. Checking it under MSDN and a general Google search should give you a good overview.

    or make the txt file into something non-edittable.
    Well, if that really is your goal, then maybe you don't really need to go to the trouble of embedding it. If you don't care if the contents can be seen in plain sight, then a simple file extension change + CRC check at runtime should do the trick. Otherwise, you may need to encrypt the contents beforehand and then decrypt them on the fly.

    Comment

    • gpraghuram
      Recognized Expert Top Contributor
      • Mar 2007
      • 1275

      #3
      Originally posted by toefraz
      Hey, guys. I'm working on a quote generating program that displays a random quote from a text file. I was just wondering if there was anyway to put that textfile inside of the .exe or make the txt file into something non-edittable. I'm new at this so I don't know all of my options. I would just like a little nudge in the right direction.

      Any help would be appreciated. Thanks

      You can put the contents in the exe file.
      I remember sometime back i read an article on this.
      The idea would be
      Open the exe in wb mode
      Reach the end of the file
      write your contents and then close the file.
      But for this you should have a wrapper exe to call this and separate out the file
      Raghuram

      Comment

      Working...