There’s another interesting application for IronPython and IronRuby: adding scripting support for your existing .NET applications. This can be a very useful and powerful way to extend your applications and give the user freedom to program their own mini programs, scripts or whatever in your applications. It could be good for defining rules, assigning and calculating values, etc.
Usage of this class is pretty simple. You have to provide the object the script you want to execute and the input variables the script will have available as local variables. Once this is done, you have to call the Execute method, and this method will either return the output variables of the execution of the resulting script, or throw an exception.
This article is on... embedding IronPython and IronRuby. It's very short, but it does show the use of the ScriptRuntime (to get access to the clr module for the hosted engine).For a more complete introduction to embedding IronPython and the DLR, you can either get IronPython in Action or read my embedding articles.