-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form6.cs
66 lines (53 loc) · 1.75 KB
/
Form6.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CalculoFormsApp
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void Form6_Load(object sender, EventArgs e)
{
}
private void BtnCalDerEx_Click(object sender, EventArgs e)
{
using Process process = new Process();
//Set the process start by using relative path
process.StartInfo.FileName = "EcSimplifier.exe";
//Dont create a window
process.StartInfo.CreateNoWindow = true;
String ecuacion = EcTextBox.Text.Replace(" ", "");
String variable = VarTextBox.Text;
String args = "D " + variable + " " + ecuacion;
process.StartInfo.Arguments = args;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
//Start the process
process.Start();
StreamReader reader = process.StandardOutput;
String result = reader.ReadToEnd();
process.WaitForExit();
AnswerLabel.Text = result;
}
private void BtnCopiar_Click(object sender, EventArgs e)
{
//Copiar el resultado al portapapeles
Clipboard.SetText(AnswerLabel.Text);
}
private void BtnPegar_Click(object sender, EventArgs e)
{
//Pegar el contenido del portapapeles en el textbox
EcTextBox.Text = Clipboard.GetText();
}
}
}