I'm working on a GUI frontend for GnuPG. VB complained about the UseShellExecute property not being set to false, so I specified it to be false. Despite this, VB still stops at testsetup.Start() with "The Process object must have the UseShellExecute property set to false in order to redirect IO streams."
What am I missing?
Thanks a Million
-JimXugle (pro n00b)
What am I missing?
VB.NET:
Private Sub GnuPGW32_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OpenDialog.CheckFileExists.Equals(True)
Dim versionstring As String
' gpgpath.Text is the path to the gpg executable.
' this is usually C:\Program Files\GNU\GnuPG\gpg.exe
If FileIO.FileSystem.FileExists(gpgpath.Text) Then
Dim testsetup As Process = New Process()
testsetup.StartInfo.FileName = gpgpath.Text
testsetup.StartInfo.Arguments = "--version"
testsetup.StartInfo.CreateNoWindow = True
testsetup.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
testsetup.StartInfo.RedirectStandardOutput = True
testsetup.StartInfo.UseShellExecute = False
testsetup.Start()
versionstring = testsetup.StandardOutput.ReadLine()
VersionLabel.Text = versionstring
End If
End Sub
Thanks a Million
-JimXugle (pro n00b)
Attachments
Last edited by a moderator: