[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! :wave:
Thanks in advance,
gtheman
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.
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
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.
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
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