第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在運(yùn)行時(shí)從 dll 引用靜態(tài)類

如何在運(yùn)行時(shí)從 dll 引用靜態(tài)類

C#
慕勒3428872 2022-08-20 17:04:27
我正在使用 從 創(chuàng)建 .然后在我的項(xiàng)目中重新啟用并進(jìn)行轉(zhuǎn)換:xsltc.exeA.dllA.xsltA.dllXslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load(typeof(A)); // A is a public static class from A.dll xslt.Transform(RootPath + "A.xml", RootPath + "A.txt");但是我如何在運(yùn)行時(shí)重新生成并進(jìn)行轉(zhuǎn)換?A.dll
查看完整描述

1 回答

?
ITMISS

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超8個(gè)贊

如果我理解正確,您希望在運(yùn)行時(shí)生成和引用 DLL。好消息是,您可以使用 在運(yùn)行時(shí)加載程序集。Assembly.LoadFrom


以下內(nèi)容取自文檔,該技術(shù)稱為反射。


Assembly SampleAssembly;

SampleAssembly = Assembly.LoadFrom("c:\\A.dll");

// Obtain a reference to a method known to exist in assembly.

var aTypes = SampleAssembly.GetTypes();

MethodInfo Method = aTypes[0].GetMethod("Method1");

// Obtain a reference to the parameters collection of the MethodInfo instance.

ParameterInfo[] Params = Method.GetParameters();

// Display information about method parameters.

// Param = sParam1

//   Type = System.String

//   Position = 0

//   Optional=False

foreach (ParameterInfo Param in Params)

{

    Console.WriteLine("Param=" + Param.Name.ToString());

    Console.WriteLine("  Type=" + Param.ParameterType.ToString());

    Console.WriteLine("  Position=" + Param.Position.ToString());

    Console.WriteLine("  Optional=" + Param.IsOptional.ToString());

}


查看完整回答
反對(duì) 回復(fù) 2022-08-20
  • 1 回答
  • 0 關(guān)注
  • 73 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)