连接asp.net页面与prolog [英] Connect a asp.net page with a prolog
本文介绍了连接asp.net页面与prolog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SbsSW.SwiPlCs;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
StreamReader myFile = new StreamReader("C:\\TS.pl");
string myString = myFile.ReadToEnd();
myFile.Close();
Environment.SetEnvironmentVariable("SWI_HOME_DIR", @"C:\\Program Files\SWI-Prolog\boot32.prc");//@"the_PATH_to_boot32.prc");
if (!PlEngine.IsInitialized)
{
SbsSW.SwiPlCs.PlEngine.Initialize(new String[] { "-q", "-f", myString });
}
}
}
可以有人告诉我我的错在哪里
我正在尝试将swi-prolog与asp.net连接,并且每次都失败。
这是我的最后一个问题>
http://dl.dropbox.com/ u / 28084245 / asp.jpg [ ^ ]
如果有人知道解决方案或知道我可以使用ASP.NET构建Prolog的方式,那么。
发送给我在ms_almouhtasb@hotmail.com。
can someone tell me where is my fault
i'm trying to connect a swi-prolog with asp.net, and every-time i fail.
this is my last problem
http://dl.dropbox.com/u/28084245/asp.jpg[^]
please if anyone know the solution or know a way that i can build a Prolog with ASP.NET.
send me at "ms_almouhtasb@hotmail.com".
推荐答案
查看此
TSWA 2008错误 - 尝试阅读或写保护的内存 [ ^ ]
我认为你必须在-f参数中用文件名初始化引擎而不是用一串Prolog代码。
I think you must initialize engine with a filename in -f parameter and not with a string of Prolog code.
SbsSW.SwiPlCs.PlEngine.Initialize(new String[] { "-q", "-f", "C:\\TS.pl" });
这篇关于连接asp.net页面与prolog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文