using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; namespace Winfrom
{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
} private void Form4_Load(object sender, EventArgs e)
{
Assembly asm = Assembly.Load("Winfrom");
var type = asm.GetType("Winfrom.Test"); var instance = asm.CreateInstance("Winfrom.Test"); type.GetProperty("Name").SetValue(instance, "hello world", null);
type.GetProperty("Id").SetValue(instance, , null); var method = type.GetMethod("Hello");
method.Invoke(instance, null); }
} public class Test
{
private int id;
private string name; public int Id
{
get { return this.id; }
set { this.id = value; }
} public string Name
{
get { return this.name; }
set { this.name = value; }
} public void Hello()
{
MessageBox.Show(Name);
}
}
}
 protected static List<Tuple<string, object, object>> AssembleyCache = new List<Tuple<string, object, object>>();

                        object myObj = null;
MethodInfo myMethod = null; if (AssembleyCache.Exists(c => c.Item1 == labelMethod))
{
myObj = AssembleyCache.First(c => c.Item1 == labelMethod).Item2;
myMethod = (MethodInfo)AssembleyCache.First(c => c.Item1 == labelMethod).Item3;
}
else
{
Assembly assembly = Assembly.Load("Yanwen.Online.Common.Print");
Type type = assembly.GetType("Yanwen.Online.Common.Print.CreatPdfUtil"); myMethod = type.GetMethod(方法名称);
myObj = Activator.CreateInstance(type, null); AssembleyCache.Add(new Tuple<string, object, object>(方法名称, myObj, myMethod));
}
if (myObj != null)
{
object[] parameter = { expressTypeModel };
var result = myMethod.Invoke(myObj, parameter);
stream = (MemoryStream)result;
}

最新文章

  1. rabiitmq集群完整安装
  2. redis入门指南-安装redis
  3. js中的this和apply
  4. Python(2.7.6) ConfigParser - 读写配置文件
  5. Ncurses &lt;一&gt;
  6. Bone Collector(01背包+记忆化搜索)
  7. Struts2中获取HttpServletRequest,HttpSession等的几种方式
  8. 【C/C++学院】(24)Oracle数据库编程--管理oracle
  9. Python安装httplib2 0.9.2
  10. 两台机子的repcached Memcache 的安装与实验
  11. php调用API支付接口(使用第三方接口,调用的天工接口。)
  12. OVS + dpdk 安装与实验环境配置
  13. graph_base_pic_segmentation里面的细节和代码
  14. BZOJ3309 DZY Loves Maths 莫比乌斯反演、线性筛
  15. 在Python中用Selenium执行JavaScript
  16. js学习——基础知识
  17. R语言:recommenderlab包的总结与应用案例
  18. &lt;记录&gt; axios 模拟表单提交数据
  19. 高并发秒杀系统方案(集成Mybatis和Redis)
  20. nyoj299——如何优雅的写矩阵快速幂

热门文章

  1. Linux下MySQL使用
  2. UIWebView获得内容的高 高度自适应 宽度自适应
  3. 【阿里云产品公测】弹性伸缩服务ESS之试用初体验
  4. 免费公测:RDS只读实例
  5. 推荐一款好用的项目管理工具:project
  6. VMware系统运维(九)VMware vSphere Client 安装
  7. nginx 代理服务器 502错误
  8. [转]div内容底部对齐
  9. 精益求精, ePub 电子书制作手记
  10. Sharepoint 2013 安装部署系列篇 第二篇 -- SQL集群安装