 | 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
SyntaxObject 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:
ObjectInstance of the class defined in the script file.
ExamplesThe following is the simple example of the interface alignment:
dynamic script = CSScript.Evaluator
.LoadFile("calc.cs");
int result = script.Sum(1, 2);
See Also