Skip to content

ES CSharp Directive Load

Codex edited this page Oct 11, 2026 · 2 revisions

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

Conexión de salidas .csx

Manual C# · Guía Práctica

La directiva del script carga otro archivo .csx. Para un proyecto normal, utilice Compile o ProjectReference.

Ejemplo sencillo (Example.csx)

Guarde este ejemplo por separado como Example.csx. Ejecútelo independientemente de los demás ejemplos de esta página.

Example.csx:

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

helper.csx:

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

Resultado:

8

Sintaxis

#load "helper.csx"

Una función auxiliar separada

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

Archivo helper.csx:

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

Archivo de configuración

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

Archivo settings.csx:

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

Fuente oficial: Microsoft Aprender.

Clone this wiki locally