Skip to content

JA CSharp Directive Load

Codex edited this page Oct 11, 2026 · 2 revisions

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

.csx 出力の接続

ディレクトリ C# · 実践的な指導

スクリプト ディレクティブは別の .csx ファイルをロードします。通常のプロジェクトの場合は、コンパイルまたは ProjectReference を使用します。

簡単な例 (Example.csx)

この例を Example.csx として別に保存し、このページの他の例とは独立して実行してください。

Example.csx:

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

helper.csx:

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

結果:

8

構文

#load "helper.csx"

独立した補助機能

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

ファイルhelper.csx:

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

設定ファイル

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

ファイルsettings.csx:

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

公式ソース: Microsoft Learn。

Clone this wiki locally