views:

56

answers:

2

Alright, so I have been wondering how to do this for a while. Basically, what I want to do is instead of downloading a file directly to the hard drive can I make my application "download it to resources"

I need to Download the file or bytes, and write it to resources.

Using a method like this to download

        byte[] example;
        using (WebClient client = new WebClient())
        {
            example = client.DownloadData("http://example.com/file.exe");
        }

If this is not possible

Would I be able to download my program into bytes then run it. All of these programs are .NET assemblies.

+2  A: 

Resource files are meant to act as static data repositories. If you want this sort of functionality, I suggest you use an embedded database such as SQLite or SQL Server Compact Edition.

Ani
+2  A: 

Although I'm kinda understanding what you want to do, your question was not clearly stated and confused everybody. So you wanna run a program which is downloaded from the Internet right? And you don't want to store that program on the hard disk but to load it to the memory on-the-fly, do you? In that case, check out:

http://stackoverflow.com/questions/595504/how-can-i-launch-a-program-from-memory-in-c

and

http://blog.devexperience.net/en/9/Load_an_EXE_file_and_run_it_from_memory.aspx

instcode
Yes, this is what I would like to do. :) I will take a look at those.
xZerox