Skip to content

IT CSharp Directive Load

Codex edited this page Oct 11, 2026 · 2 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

Collegamento delle uscite .csx

Manuale C# · Guida pratica

La direttiva script carica un altro file .csx. Per un progetto normale, usa Compila o ProjectReference.

Esempio semplice (Example.csx)

Salvare questo esempio separatamente come Example.csx. Eseguirlo indipendentemente dagli altri esempi di questa pagina.

Example.csx:

#load "helper.csx"
UO.Print(Double(4).ToString());

helper.csx:

int Double(int value) => value * 2;

Risultato:

8

Sintassi

#load "helper.csx"

Una funzione ausiliaria separata

#load "helper.csx"
UO.Print(Double(4).ToString());

File helper.csx:

int Double(int value) => value * 2;

File di configurazione

#load "settings.csx"
UO.Print($"{ProfileName}:{Limit}");

File settings.csx:

string ProfileName = "Archer";
int Limit = 3;

Fonte ufficiale: Microsoft Impara.

Clone this wiki locally