How do I write vb.net code to compile C / C ++ programs?

I am trying to create a vb.net application that has 2 text boxes, 7 radio buttons, and 2 buttons (one is compiled and the other is "launch"). How do I load the content of a C / C ++ file (or any programming language) into the 1st text box and clicking the compile button, I should be able to show errors or C / C ++ program in the second text box. When I click the Run button, I have to show the output in the second text box. In short, I want to use the second textbox as my terminal / console. The radio buttons are 4 language choices C or C ++ or python or C # or java or perl or vb. Are the compilers of all these languages ​​in .net? If so, how can I name them?

+1


a source to share


2 answers


Look at the namespace System.IO

for information on how you load the contents of the file into the textbox. In particular, the class File

.

System.IO.File Class

Look at the namespace System.Diagnostics

for information on how to start the process and capture the output. In particular, the class Process

.

System.Diagnostics.Process Class



This SO page ...

Capturing console output in .NET (C #)

... will give you more information on capturing console output.

+2


a source


Compilation can be done by calling cl.exe that ships with Visual Studio. You can of course use GCC as well.



+1


a source







All Articles