This project is read-only.

Project Description

This library allows you to add active scripting to your .NET applications. This includes adding your own .NET classes as named objects in the script language. This will allow your customers to customize and extend your .NET object model via VBScript, JScript, or any other Active Scripting language. The library includes source code written in C#. One advantage of using ActiveScript is that no dynamically compiled assemblies will hang around in memory or need to be put in a separate application domain so that they can be unloaded.

This can useful for porting legacy applications that still need to support existing scripts.

Example Usage

See included sample project for adding your own .NET class as a named object in the script

Simple Script:

VBScript vbscript = new VBScript();

vbscript.AddScript("MsgBox \"Hello World\"");
vbscript.Open();
vbscript.Close();

Calling a Function:

StringBuilder script = new StringBuilder();
script.Append("Function Add(left, right)");
script.Append("Add = left + right");
script.Append("End Function");

VBScript vbscript = new VBScript();

vbscript.AddScript(script.ToString());
vbscript.Open();
int result = Convert.ToInt32(vbscript.ExecuteMethod("Add", new object[] { 4, 5 }));
vbscript.Close();

MessageBox.Show("4 5 = " result.ToString());

Eric Eicke

Last edited Oct 24, 2008 at 12:29 AM by eeicke, version 6