G
Guest
I have a program that runs a second program with the following code:
Dim process As New Process()
Dim FileName As String = "externalprog.exe"
Dim Arguments As String
Arguments = "/c"
process.StartInfo.UseShellExecute = False
process.StartInfo.RedirectStandardOutput = True
process.StartInfo.RedirectStandardError = True
process.StartInfo.CreateNoWindow = True
process.StartInfo.FileName = FileName
process.StartInfo.Arguments = Arguments
process.StartInfo.WorkingDirectory = Application.StartupPath
process.Start()
Return process.StandardOutput.ReadToEnd()
The advanatge to running my code like this is I can read the output from the
dos prompt.
The problem is this external program does log any data if the process fails
but it does send an email. I am wondering if there is a way to have my
program that runs this one act as a temporary smtp server and recieve the
email the external program sends and then read the error out of the body of
the email? If possible this would have to work on a server that currently
has a smtp server runing.
Thanks!
Dim process As New Process()
Dim FileName As String = "externalprog.exe"
Dim Arguments As String
Arguments = "/c"
process.StartInfo.UseShellExecute = False
process.StartInfo.RedirectStandardOutput = True
process.StartInfo.RedirectStandardError = True
process.StartInfo.CreateNoWindow = True
process.StartInfo.FileName = FileName
process.StartInfo.Arguments = Arguments
process.StartInfo.WorkingDirectory = Application.StartupPath
process.Start()
Return process.StandardOutput.ReadToEnd()
The advanatge to running my code like this is I can read the output from the
dos prompt.
The problem is this external program does log any data if the process fails
but it does send an email. I am wondering if there is a way to have my
program that runs this one act as a temporary smtp server and recieve the
email the external program sends and then read the error out of the body of
the email? If possible this would have to work on a server that currently
has a smtp server runing.
Thanks!