Hi maestros,
How can I execute a program that is in a MemoryStream so I don't have to save it first to the harddisk. The file may not be saved temperally to the harddisk. The program has to be 100% functional from in memory.
static string strTemplate = "MyAPP.SOMEprogram.exe";
byte[] template;
int len = 0;
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream(strTemplate))
{
len = (int)stream.Length;
BinaryReader reader = new BinaryReader(stream);
template = reader.ReadBytes(len);
}
MemoryStream ms = new MemoryStream(template, true);
Now all 100% working program in MemoryStream (on RAM), can i execute that program? Many Thanks