-
-
Save anonymous/845ef45673c7de9770f1b3fded930491 to your computer and use it in GitHub Desktop.
use VB .NET to interact with pronsole.exe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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