Execute c# code from a string?

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

I have a problem which most people may find weird but please stick
with me :) Is it possible to execute a c# application held in a
memory buffer (a string) without first saving it to disk? I need to
receive the code from a remote website over SSL and then execute it
from memory. Basically I'm trying to protect the source code from
being accessed from the website executing it. Is there a better way
without using DLL's? The users of the website must maintain full ftp
access.

Thanks
 
Take a look at the following code and it might give you a start:
http://odetocode.com/Code/80.aspx, you'll just need to use a
CSharpCodeProvider and then find the entry point into the assembly.

Just keep in mind all the security implications of executing code over
the network.

HTH,
 
Back
Top