Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Diagnostics;
- namespace WinProlog
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- richTextBox1.Clear();
- Process prolog = new Process();
- prolog.StartInfo.FileName = "swipl";
- string path = AppDomain.CurrentDomain.BaseDirectory.Replace(@"\", @"\\");
- prolog.StartInfo.Arguments = "-q -g \"consult('" + path + "parenti.pl'), " + textBox1.Text + ", halt\"";
- prolog.StartInfo.RedirectStandardOutput = true;
- prolog.StartInfo.UseShellExecute = false;
- prolog.StartInfo.CreateNoWindow = true;
- prolog.Start();
- string output = prolog.StandardOutput.ReadToEnd();
- prolog.WaitForExit();
- richTextBox1.Text = output;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement