zoukankan      html  css  js  c++  java
  • MaxScript中使用动态编译的C#

    MaxScript中使用动态编译的C#
    CSharpCodeSource ="using System;
    using System.Windows.Forms;
    namespace TestNameSpace
    {
    public class TestClass
    {
    public void Test(string theString)
    {
    MessageBox.Show(theString);
    }
    }
    }
    "
    CSharpProvider
    = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
    CompilerParams
    = dotnetobject "System.CodeDom.Compiler.CompilerParameters"

    CompilerParams.ReferencedAssemblies.Add(
    "System.dll")
    CompilerParams.ReferencedAssemblies.Add(
    "System.Windows.Forms.dll")
    CompilerParams.GenerateExecutable
    = false
    CompilerParams.GenerateInMemory
    = false

    CompilerResults
    = CSharpProvider.CompileAssemblyFromSource CompilerParams #(CSharpCodeSource)

    WinAssembly
    = CompilerResults.CompiledAssembly
    TestAssembly
    = WinAssembly.CreateInstance "TestNameSpace.TestClass"
    TestAssembly.Test
    "动态编译的C#"

    (DotNetObject
    "TestNameSpace.TestClass").Test "动态编译的C#"
  • 相关阅读:
    axios基础用法
    CSS盒子模型
    前端跨域问题解决方案
    跨域-iframe
    swagger UI配置
    React安装和启动
    React 学习笔记
    redis学习笔记
    10个排序算法,待更新
    docker常用命令,持续更新。。。
  • 原文地址:https://www.cnblogs.com/sitt/p/1772003.html
Copyright © 2011-2022 走看看