简体   繁体   中英

Does c# support any scripting language

I need my superusers to write some basic expressions like (getting today, or getting first day of last month, or just returning a default int value like 40), that I can later execute and get the result. It will be used for basic scripting that will provide an optional default value for a report parameter. It would be nice if it did not require any additional installation

So does c-sharp support any scripting languages that it can happily execute and evaluate?

thanks in advance,

It's an ASP.Net application and .Net Framework 4.5

LUA是一种可以在C#中使用的脚本语言,请查看LuaInterface

You can use NLua ( http://nlua.org/ https://www.nuget.org/packages/NLua/ )

Super easy to integrate, and work on any platform.

I recently used IronPython to provide "scripting" to a program. You can embed the IronPython runtime in your program and let it execute scripts passed as a string. Look here for some examples.

You can also execute C# code compiled on the fly. See here .

Short answer, yes. There are a lot of different possible script engines for pretty much any possible scripting language.

Personally, i like to use C# for scripts too. Then make the program load the script file and compile it runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM