How do I get started designing and implementing a script interface for my .NET application?

后端 未结 8 922
礼貌的吻别
礼貌的吻别 2021-01-30 13:47

How do I get started designing and implementing a script interface for my .NET application?

There is VSTA (the .NET equivalent of VBA for COM), but as far as I understan

8条回答
  •  北海茫月
    2021-01-30 14:10

    I'm not sure this will cover your needs, but via reflection you can compile C# code and execute it at runtime (example code here).

    So you could write the script in eg. C# and then compile "it on the fly" and run it directly in the context of your application. Of course you have to keep security considerations in mind, but if the scripts are trusted then it might work for you, and you get the benefits of using a powerful managed language for your scripts.

    If you need high performance or running thousands of scripts it might be too slow though.

提交回复
热议问题