http://blog.csdn.net/yxbsmx/article/details/5268396
打开VS2008,新建一个基础上,
添加COM引用:
private void button2_Click(object sender, EventArgs e)
{
MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControlClass();
sc.Language = "JavaScript";
MessageBox.Show(sc.Eval("((2*3)-5+(3*4))+6/2").ToString());//1+12+3
}
运行结果:16