惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - meetweb

IDEA 使用generator逆向工程生成pojo,mapper Ambiguous reference to member 'dataTask(with:completionHandle:)'错误 swift3.0  代码创建经典界面的九宫图--优化篇 swift3.0 创建经典界面的九宫图 AlertDialog中使用ListView绑定数据 bootstrap table教程--后台数据绑定、特殊列处理、排序 bootstrap table教程--使用入门基本用法 jqGrid使用json实现的范例一 android logger的使用 Visual 2015创建新项,缺少ADO.NET 实体数据模型的解决方法 在VisualStadio2015上使用EF6.0建立MySql数据库 事件使用(转 ) 使用Dotfuscator 进行.Net代码混淆 代码加密的方法 Git分布式版本控制系统学习笔记 免费SVN服务器笔记 如何设置mysql远程访问及防火墙设置 c# GridControl怎么换行 模拟Post登陆带验证码的网站 c#控制打印机杂项
通过反射获取DLL的类实现加载窗体
meetweb · 2016-11-11 · via 博客园 - meetweb

1.创建一个DLL 类库,并新建一个窗体类,这个直接在vs上操作就好

2. 建立一个Testassembly工程

新建一个测试类

namespace Testassembly
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string ss = AppDomain.CurrentDomain.BaseDirectory + "Debug\\TestDll.dll";
            Assembly assembly = Assembly.LoadFile(ss);

            //获取类型,参数(名称空间+类)   
            Type type = assembly.GetType("TestDll.Form1");

            //创建该对象的实例,object类型,参数(名称空间+类)   
            
           // System.Reflection.MethodInfo method = type.GetMethod("Show");//方法的名称
            object instance = assembly.CreateInstance("TestDll.Form1");
            Form frm = (Form)instance;
            frm.Show();
           // method.Invoke(instance,Object[] parametors = new Object[] { "param" });
        }
    }
}

效果就是弹出一个新的窗口