星空网 > 软件开发 > ASP.net

c# 反射简单使用

类库dll,将生成ExampleLib.dll文件

namespace ExampleLib{  public class Example  {    public static string FuncA()    {      return "FuncA";    }    public string FuncB()    {      return "FuncB";    }  }}

反射调用。创建实例并调用示例中的方法

  class Program  {    static void Main(string[] args)    {      dynamic example = Assembly.Load("ExampleLib").CreateInstance("ExampleLib.Example");       Console.WriteLine(example.FuncB());      Console.ReadKey();    }  }

 




原标题:c# 反射简单使用

关键词:C#

C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

跨境电商行业资讯:https://www.goluckyvip.com/tag/35791.html
跨境电商好不好:https://www.goluckyvip.com/tag/35792.html
跨境电商好的培训:https://www.goluckyvip.com/tag/35793.html
跨境电商好发展吗:https://www.goluckyvip.com/tag/35794.html
跨境电商好吗:https://www.goluckyvip.com/tag/35795.html
跨境电商好学吗:https://www.goluckyvip.com/tag/35796.html
武陵山大裂谷周围景点 武陵山大裂谷周围景点图片:https://www.vstour.cn/a/411233.html
南美旅游报价(探索南美洲的旅行费用):https://www.vstour.cn/a/411234.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流