Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Handbook C# · Practical Guide
The script directive loads another .csx file. For a regular project, use Compile or ProjectReference.
Save this example separately as Example.csx. Run it independently of the other examples on this page.
Example.csx
Example.csx:
#load "helper.csx" UO.Print(Double(4).ToString());
helper.csx:
helper.csx
int Double(int value) => value * 2;
Result:
8
#load "helper.csx"
File helper.csx:
#load "settings.csx" UO.Print($"{ProfileName}:{Limit}");
File settings.csx:
settings.csx
string ProfileName = "Archer"; int Limit = 3;
Official source: Microsoft Learn.
There was an error while loading. Please reload this page.