您现在的位置是:首页 >

linux编译动态库连接 详解.NET中的动态编译[5]

火烧 2021-06-25 20:15:48 1034
详解.NET中的动态编译[5]   对于客户端的输入程序 我们需要继承于Mar halByRefO ject类和IRemoteI terface接口 并添加对RemoteAcce 程序集的引用 以下为

详解.NET中的动态编译[5]  

  对于客户端的输入程序 我们需要继承于MarshalByRefObject类和IRemoteInterface接口 并添加对RemoteAccess程序集的引用 以下为输入

linux编译动态库连接 详解.NET中的动态编译[5]

     

using System;

using System Reflection;

using RemoteAccess;

 

namespace Dynamicly

{

    public class HelloWorld : MarshalByRefObject IRemoteInterface

    {

        public object Invoke(string strMethod object[] Parameters)

        {

            return this GetType() InvokeMember(strMethod BindingFlags InvokeMethod null this Parameters);

        }

 

        public string GetTime(string strName)

        {

            return  Wele + strName + Check in at + System DateTime Now ToString();

        }

    }

}

  这样 你可以通过适时的编译 加载和卸载程序集来保证你的程序始终处于一个可控消耗的过程 并且达到了动态编译的目的 而且因为在不同的应用程序域中 让你的本身的程序更加安全和健壮 示例代码下载 //files cnblogs /zlgcool/DynamicCompiler rar

lishixinzhi/Article/program/net/201311/14548  
永远跟党走
  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

    • 微信收款码
    • 支付宝收款码