1

I'm trying to make a vb.net application that has got 2 textboxes, 7 radio buttons and 2 buttons(one named compile and the other 'run'). How can I load the content of a C/C++(or any programming language) file into the 1st textbox and on clicking the compile button, i should be able to show the errors or the C/C++ program in the 2nd textbox. On clicking Run, I should be able to show the output in the 2nd textbox. In short, I want to use the 2nd textbox as a terminal/console. The radio buttons are 4 selecting the language C or C++ or python or C# or java or perl or vb. Are the compilers of all these languages present in .net? If so how can I call them?

abc
  • 31
  • 1
  • 6

2 Answers2

2

Look at the System.IO namespace for clues as to how you go about loading the contents of a file into a text box. In particular, the File class.

System.IO.File Class

Look at the System.Diagnostics namespace for clues as to how to go about launching a process and capturing the output. In particular, the Process class.

System.Diagnostics.Process Class

This SO page...

Capturing the Console Output in .NET (C#)

... will give you some more info around capturing console output.

Community
  • 1
  • 1
Martin Peck
  • 11,440
  • 2
  • 42
  • 69
1

Compiling can be done by calling cl.exe which comes with Visual Studio. Of course you could also use GCC instead.

Erich Kitzmueller
  • 36,381
  • 5
  • 80
  • 102