Skip to content

Instantly share code, notes, and snippets.

/Module1.vb Secret

Created August 11, 2017 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/845ef45673c7de9770f1b3fded930491 to your computer and use it in GitHub Desktop.
Save anonymous/845ef45673c7de9770f1b3fded930491 to your computer and use it in GitHub Desktop.
use VB .NET to interact with pronsole.exe
Imports System.IO
Module Module1
Private Const PRONSOLE As String = "D:\Develop\Printrun-Win-Slic3r-03Feb2015\pronsole.exe"
Public Sub Main()
Dim process As Process = New Process With {
.StartInfo = New ProcessStartInfo() With {
.FileName = PRONSOLE,
.UseShellExecute = False,
.RedirectStandardInput = True,
.RedirectStandardOutput = True,
.RedirectStandardError = True
}
}
AddHandler process.OutputDataReceived, AddressOf Process_OutputDataReceived
process.Start()
process.BeginOutputReadLine()
Dim writer As StreamWriter = process.StandardInput
writer.WriteLine("")
'writer.WriteLine("help")
writer.Close()
process.WaitForExit()
process.Close()
Return
End Sub
Sub Process_OutputDataReceived(sender As Object, e As DataReceivedEventArgs)
Dim data As String = e.Data
Console.WriteLine(data)
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment