有人可以解释我的Assembly类的功能给我吗? [英] Can someone explain me the functionality of the Assembly Class to me?

查看:171
本文介绍了有人可以解释我的Assembly类的功能给我吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要加载和运行时,有人在创建组件告诉我使用的命名空间System.Reflection.Assembly和System.Reflection.Emit。

I want to Load and Create Assemblies during runtime and someone told me to use the Namespace System.Reflection.Assembly and System.Reflection.Emit.

仅供参考,我发现在MSDN,但it's不如与它的工作。当您不知道在哪里以及如何下手。我已经用Google搜索,但我didn't找到任何有用的教程/样本/引用。

Only reference I found was on the msdn, but it´s not as good to work with it when you don´t know where and how to start. I already googled but I didn´t find any useful tutorials/samples/references.

有人能解释的功能给我或给我一些样本/教程?

Can someone explain the functionality to me or give me some samples/tutorials?

推荐答案

HTTP: //msdn.microsoft.com/en-us/library/saf5ce06.aspx

 public static void CompileScript(string source)
        {
            CompilerParameters parms = new CompilerParameters();
            parms.GenerateExecutable = true;
            parms.GenerateInMemory = true;
            parms.IncludeDebugInformation = false;
            parms.ReferencedAssemblies.Add("System.dll");
            // Add whatever references you might need here 
            CodeDomProvider compiler = CSharpCodeProvider.CreateProvider("CSharp");
            CompilerResults results = compiler.CompileAssemblyFromSource(parms, source);
            file.move(results.CompiledAssembly.Location,"c:\myassembly.dll");
        }

这篇关于有人可以解释我的Assembly类的功能给我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆