Results 1 to 5 of 5

Thread: programatically insert code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    96

    programatically insert code

    I'm trying to make a form that allows users to register new tools with the database. I know how to update the sql server with that information, but there's quite a bit of code that accompanies specific tools (which alter labels on textboxes, etc.) Is it possible to programmatically update the software according to information put into a 'add new tool' form without touching the source code?

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: programatically insert code

    Do you play games? Have you ever played any that have mods built by the users? That would be one model for how to go about it. However, in cases like that, the mods are added the next time the program runs. You could kind of get around that by breaking the program up, perhaps, so long as the part that is being modified is not the part that is being run.

    Does that sound like a viable option?
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    96

    Re: programatically insert code

    Hmm...I don't play games but I assume it similar to patches...I suppose I'd have to set up a system where the program checks for updates, and adding a new tool would insert the needed update in another batch of code to be run then. That may be more trouble than its worth in my application, since we have plenty of programmers on site, who could dive into the source code and make the alterations. Could you directly alter the code behind a .NET application without rebuilding? It doesn't seem likely...

  4. #4
    Fanatic Member
    Join Date
    Jun 2008
    Location
    Portland, OR, USA
    Posts
    659

    Re: programatically insert code

    Somewhere in recent history right here in this forum there was a description of how to compile code at runtime. You would need to do some text manipulation, and then feed the assembled text into whatever it was (There is a .NET library for CodeDom and Compiler objects . . .) which would compile at Runtime. I'll see if I can find the post I am referring to and if I do, I'll get back to you.

  5. #5
    Fanatic Member
    Join Date
    Jun 2008
    Location
    Portland, OR, USA
    Posts
    659

    Re: programatically insert code

    If you follow THIS Link, you will end up in another post on this subject. Follow the links referenced by Keystone Paul.

    Hope that helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width