添加COM引用:
Microsoft Sctipt Control 1.0
         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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2021-09-07
猜你喜欢
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案