Reading and writing to an embedded file

This is a discussion on Reading and writing to an embedded file within the C# Programming forums, part of the General Programming Boards category; Hey guys, I've been thinking about this for a while, but I can't find any way on how to do ...

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    26

    Reading and writing to an embedded file

    Hey guys, I've been thinking about this for a while, but I can't find any way on how to do this.

    Basically what I want to do is have an embedded file in my program, that can be written to. This would be used to store a randomly generated password, that would be created and stored when the program was first run, and then read every time after.

    I've looked at embedded resources, but it seems like you can only read from them. I've also looked at serialization, but everywhere I've looked suggests that files and such that are serializable are not able to be embedded into the application and modified. And lastly, I've looked at having a "settings" file, but that is stored in the application data, which isn't what I want.

    If anyone has an idea on how to get this working, it would be appreciated.

  2. #2
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    How about storing it in the registry?

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,649
    You could use Isolated Storage as well.

  4. #4
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Or possibly use the ResourceWriter class.

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    26
    Thanks for the responses guys, I'll check out each one and see if they work with what I want to do.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. segmetation fault (reading and writing file in c)
    By tasosa in forum C Programming
    Replies: 5
    Last Post: 04-13-2009, 06:04 AM
  2. Reading out of and writing into the same file
    By Wiretron in forum C Programming
    Replies: 8
    Last Post: 12-30-2006, 01:04 PM
  3. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  4. file writing and reading
    By Micko in forum C Programming
    Replies: 8
    Last Post: 01-13-2004, 10:18 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21