Write to Standard Input

R

rzaleski

For some reason my application is not writing to Standard Input. Here
is my code:

Dim pInfo As ProcessStartInfo
Dim errors As String = ""
Dim errorEntry As ThreadStart

pInfo = New ProcessStartInfo("C:\Program
Files\GNU\GnuPG\gpg.exe", "-r (e-mail address removed) -o C:\out.txt
--decrypt C:\test.txt.gpg")
pInfo.CreateNoWindow = False
pInfo.UseShellExecute = False
pInfo.RedirectStandardInput = True
pInfo.RedirectStandardOutput = True
pInfo.RedirectStandardError = True
_process = Process.Start(pInfo)

_process.StandardInput.Write("TEST")
_process.StandardInput.Flush()
_process.StandardInput.Close()

It never writes "TEST". It is waiting for the passphrase to be endered
(this is obviously for decrypting a file encripted with gpg).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top