Execute c# code from a string?

Discussion in 'ASP .Net' started by Andy, May 18, 2004.

  1. Andy

    Andy Guest

    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
    Andy, May 18, 2004
    #1
    1. Advertising

  2. Andy

    Curt_C [MVP] Guest

    Eval(stringHere) perhaps?

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Andy" <> wrote in message
    news:...
    > 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
    Curt_C [MVP], May 18, 2004
    #2
    1. Advertising

  3. Andy

    Scott Allen Guest

    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,

    --
    Scott
    http://www.OdeToCode.com


    On 18 May 2004 11:51:07 -0700, (Andy) wrote:

    >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
    Scott Allen, May 18, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nick
    Replies:
    2
    Views:
    369
    Rick Strahl [MVP]
    Dec 24, 2003
  2. rooster575
    Replies:
    2
    Views:
    356
    rooster575
    Jul 15, 2004
  3. Kamal Ahmed
    Replies:
    1
    Views:
    5,189
    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
    Oct 25, 2005
  4. jwaixs
    Replies:
    2
    Views:
    927
    jwaixs
    Jun 27, 2005
  5. Savas Ates
    Replies:
    1
    Views:
    266
    Patrice
    Aug 17, 2004
Loading...

Share This Page