Click or drag to resize

IEvaluatorLoadFile Method (String, Object)

Evaluates and loads C# code from the specified file to the current AppDomain. Returns instance of the first class defined in the script file.

Namespace:  CSScriptLib
Assembly:  CSScriptLib (in CSScriptLib.dll) Version: 1.3.2.0
Syntax
C#
Object LoadFile(
	string scriptFile,
	params Object[] args
)

Parameters

scriptFile
Type: SystemString
The C# script file.
args
Type: SystemObject
Optional non-default constructor arguments.

Return Value

Type: Object
Instance of the class defined in the script file.
Examples
The following is the simple example of the interface alignment:
dynamic script = CSScript.Evaluator
                         .LoadFile("calc.cs");

int result = script.Sum(1, 2);
See Also