方法一:
引用using Microsoft.JScript.dll
然后使用Eval.JScriptEvaluate方法
具体如下:
string result = string.Format("({0}-{1})/100",500,100);
Console.WriteLine(Microsoft.JScript.Eval.JScriptEvaluate(result, Microsoft.JScript.Vsa.VsaEngine.CreateEngine()).ToString());

方法二:
str_value = new DataTable().Compute(string.Format(tbCount_Rules.Text.Trim(), ListToObject(percount)), "").ToString();

相关文章:

  • 2021-11-23
  • 2021-06-06
  • 2022-02-03
  • 2022-02-04
猜你喜欢
  • 2021-11-15
  • 2021-12-15
  • 2021-09-06
  • 2021-08-05
  • 2021-06-21
  • 2022-02-21
  • 2021-05-14
相关资源
相似解决方案