Results 1 to 6 of 6

Thread: [02/03] Adding embedded resource in runtime

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Location
    In front of my pc
    Posts
    78

    [02/03] Adding embedded resource in runtime

    hey guys,

    I know it is possible to embed resources in the design-time, but is it also possible to embed (or change, it'll be a simple textfile) a file programmatically? I'd like to know if this is possible before I start programming as this would change the whole concept of my application. Any help is appreciated!

    Thanks in advance,

    gtheman

  2. #2
    Lively Member
    Join Date
    Jun 2006
    Location
    City of Angles. Right Angles.
    Posts
    110

    Re: [02/03] Adding embedded resource in runtime

    I don't think you can do that at runtime. It would require re-compiling the application including the new data. I'm not 100% certain, but from my basic knowledge of how resources and compilers work together, I don't think it's possible.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Location
    In front of my pc
    Posts
    78

    Re: [02/03] Adding embedded resource in runtime

    Ok... I've been thinking and might have found another solution. Is it possible to add an embedded resource to another project without having visual studio installed, so purely relying on a self-written application which manipulates a project file and the compiler(which is included in the .net framework, or am I wrong?), which recompiles the exe-file with the required files which have been added. Let's hope this is possible (couldn't find anything on google, but that can also rely on the fact that I'm tired and about to go to bed).

    Gtheman

    By the way: Thanks for the quick reply supertotallyawesome

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Adding embedded resource in runtime

    The whole point of using resources is so that they are inaccessible from outside the app at run time. If you want to change the contents of a file at run time then you don't want a resource, plain and simple. You would embed a text file as a resource if you were going to use it as a template for files that you were going to create at run time, but you don't change the resource itself. It is possible to use the Framework to compile code at run time but I have no idea how it's done and I guarantee you that it is not something that beginners or probably even intermediate programmers should normally be doing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [02/03] Adding embedded resource in runtime

    Quote Originally Posted by jmcilhinney
    The whole point of using resources is so that they are inaccessible from outside the app at run time. If you want to change the contents of a file at run time then you don't want a resource, plain and simple. You would embed a text file as a resource if you were going to use it as a template for files that you were going to create at run time, but you don't change the resource itself. It is possible to use the Framework to compile code at run time but I have no idea how it's done and I guarantee you that it is not something that beginners or probably even intermediate programmers should normally be doing.
    Very correct, if you are adding them at run-time they cannot be embedded resources (%100 No WAY).
    But you might save your data in a table or compress it in a zip file
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Location
    In front of my pc
    Posts
    78

    Re: [02/03] Adding embedded resource in runtime

    So it is not possible that the executable of project a adds an embedded resource to project b(which is not bein used of course) and compiles project b after having added the resource(s)?

    Oh Well, I'll somehow find another solution ...

    Thanks anyways,

    gtheman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width