请帮我解决以下问题。
我在使用 C# 从 Visual Studio2012 调用 Wolfram Mathematica 时遇到 Mathlink 异常。请看下面的代码。它还显示“错误代码:1012。协议不可用”
private void button1_Click(object sender, EventArgs e)
{
// This launches the Mathematica kernel:
IKernelLink ml = MathLinkFactory.CreateKernelLink();
ml.WaitAndDiscardAnswer();
// Now compute 2+2
string result = ml.EvaluateToOutputForm("2+2", 0);
Console.WriteLine("2 + 2 = " + result);
ml.Close();
// Wait for user to close window.
Console.WriteLine("Press Return to exit...");
Console.Read();
}
异常截图