ZH TW CSharp Directive Load - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
聯繫 .csx 當地人
腳本指令載入另一個 .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學習。