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. How to compile a txt into an exe

How to compile a txt into an exe

Scheduled Pinned Locked Moved C#
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.
  • S Offline
    S Offline
    sduhd
    wrote on last edited by
    #1

    My program reads some data from a txt. I want to compile the txt into the exe itself, so I won't distribute the txt file. If possible, how? Thanks.

    C L 2 Replies Last reply
    0
    • S sduhd

      My program reads some data from a txt. I want to compile the txt into the exe itself, so I won't distribute the txt file. If possible, how? Thanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can add the text as a resource, most likely just add it to the settings, which means they will appear in the app.config file.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • S sduhd

        My program reads some data from a txt. I want to compile the txt into the exe itself, so I won't distribute the txt file. If possible, how? Thanks.

        L Offline
        L Offline
        Lord Kixdemp
        wrote on last edited by
        #3

        If you go with putting it as a resource, then people can still look at it using a resource editor like ResHack... If you want full security, encrypt it first, then add it in the resource script. But then again, some hacker with a disassembler can decode the encryption key and view the file... If your program can read it, then anyone (with sufficient experience) can also. (Which is exactly why software developers are having tough times with piracy... there's no way to prevent it. :()

        Windows Calculator told me I will die at 28. :(

        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