同步操作将从 蛋蛋/cs-script 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The project has been migrated to GitHub from CodePlex: CS-Script.
CS-Script is a CLR (Common Language Runtime) based scripting system which uses ECMA-compliant C# as a programming language.
CS-Script is one of the most mature C# scripting solutions. I become publicly available in a two years after the first release of .NET. CS-Script supports both hosted and standalone execution model. It allows seamlessly switching underlying compiling technology without affecting the code base. Currently supported compilers are Mono, Roslyn and CodeDOM. It offers comprehensive integration with most common development tools.
For the all CS-Script details go to the project Documentation Wiki.
The following is a simple code sample just to give you the idea about the product:
dynamic script = CSScript.LoadCode(
@"using System.Windows.Forms;
public class Script
{
public void SayHello(string greeting)
{
MessageBox.Show($""Greeting: {greeting}"");
}
}")
.CreateObject("*");
script.SayHello("Hello World!");
//-----------------
var product = CSScript.CreateFunc<int>(@"int Product(int a, int b)
{
return a * b;
}");
int result = product(3, 4);
//-----------------
var SayHello = CSScript.LoadMethod(
@"using System.Windows.Forms;
public static void SayHello(string greeting)
{
MessageBoxSayHello(greeting);
ConsoleSayHello(greeting);
}
static void MessageBoxSayHello(string greeting)
{
MessageBox.Show(greeting);
}
static void ConsoleSayHello(string greeting)
{
Console.WriteLine(greeting);
}")
.GetStaticMethod("SayHello" , typeof(string));
SayHello("Hello again!");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。