Hi!
Has anyone tried to redirect binary data using the process.standardInput
methods?

I have the following code that works for files under 60 K.
For some reason processing files over that size hangs the app.

Please please help!! My head hurts...

This is the code:
Dim pInfo As New ProcessStartInfo
Dim timeOut As Integer = 5000
With pInfo
.FileName = FormFontRoot & "bin\findpage.exe"
.Arguments = PageNum.ToString & " " & PageNum.ToString
.WindowStyle = ProcessWindowStyle.Hidden
.CreateNoWindow = True
.UseShellExecute = False
.RedirectStandardError = True
.RedirectStandardOutput = True
.RedirectStandardInput = True
End With

'Start the process.
Dim p As Process = Process.Start(pInfo)

'Write to standard Input
Dim br As BinaryReader = New BinaryReader(File.Open(FileName,
FileMode.Open))
Dim Bytes(4096) As Byte
Dim BytesRead As Integer
While br.PeekChar <> -1
BytesRead = br.Read(Bytes, 0, Bytes.Length)
p.StandardInput.BaseStream.Write(Bytes, 0, BytesRead)
End While
br.Close()
p.StandardInput.Close()

''Write to stdOUt
Dim FileOut As String = FileName & ".p" & PageNum.ToString
If IO.File.Exists(FileOut) Then IO.File.Delete(FileOut)

Dim FileStrm As FileStream = New FileStream(FileOut, _
FileMode.CreateNew, FileAccess.Write, FileShare.Write)

Dim bw As BinaryWriter = New BinaryWriter(FileStrm)
BytesRead = p.StandardOutput.BaseStream.Read(Bytes, 0,
Bytes.Length)
While BytesRead <> 0
bw.Write(Bytes, 0, BytesRead)
BytesRead = p.StandardOutput.BaseStream.Read(Bytes, 0,
Bytes.Length)
End While
bw.Close()
p.StandardOutput.Close()

p.WaitForExit(timeOut)