Read text from console app using vb.net?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi guys.

I have such a task.
I am developing a VB.NET app (as WindowsExe application, not console) to
work with Oracle DB.
To retrieve the data, I use such method: call PLUS80.EXE, witch takes db
username and password, connects to db, executes given SQL script and writes
data to CSV files.
PLUS80.EXE is a console app, I call it using SHELL command in vb.net:

Shell("PLUS80 " & User & "/" & Pass & " @export.sql", AppWinStyle.Hide,
True)

So, PLUS80 executes in a hidden window, in order to simplify the work with
my app (not to confuse user with pop-up windows). And the main app waits
till PLUS80 finishes.
If smth goes wrong, e.g. bad username or password is given, PLUS throws an
exception (like ORA-xxxxx: some text) and waits for user actions (e.g. enter
password manually). The problem is, that is such a case PLUS80 "freezes",
and the main app also freezes waiting for PLUS80 exiting. User can do
nothing, because it sees nothing - the PLUS80 window is hidden.

So, I'd like to have a tool to enable my main app to retrieve the text from
PLUS80 window (that means, the text from that console window that is
outputed). Then I'll be able to strip from all that text the line containing
string like "ORA-xxxxx", and show it to the user by using MsgBox.
And the second part, i need a tool to send some text to console (like "exit"
command, witch will end PLUS80, and my main app "unfreezes"), imitating
pressing the
keyboard keys ending with "Enter" key pressing.

I know how to retrieve the handle of console window using FindWindow API,
but that's all.
I heard there are functions smth like ReadConcoleText, but no egamples how
to use it from an VB.NET

The main app is designet to work on Windows 2000 and Windows XP.


Thanks for any idea.






.



Relevant Pages

  • Re: Read text from console app using vb.net?
    ... As this isn't your console though, it will probalby take some win API. ... PLUS80.EXE is a console app, I call it using SHELL command in vb.net: ... So, PLUS80 executes in a hidden window, in order to simplify the work ... PLUS80 window is hidden. ...
    (microsoft.public.vb.general.discussion)
  • Read text from console app using vb.net?
    ... I am developing a VB.NET app (as WindowsExe application, not console) to ... till PLUS80 finishes. ... because it sees nothing - the PLUS80 window is hidden. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Weird focus problem (and mysterious invisible console) running wish on windows.
    ... But I never asked for a console in my app. ... is no visible console window on the screen, nor is there a console on ... - If I either Alt-Tab my way to the app, ...
    (comp.lang.tcl)
  • Re: Terminal server client and old dos programs
    ... When running on the console, will it run in windowed mode, or only full screen? ... No full-screen for DOS applications in Terminal Server. ... >> can get is by simulating full-screen with a window that covers the entire ... >> non-admins can't run the app, then it's a permissions or rights issue. ...
    (microsoft.public.windows.terminal_services)
  • Re: Read text from console app using vb.net?
    ... The only thing you can pass using a console app are strings, and they are used as parameters in the constructor from the application. ... So, PLUS80 executes in a hidden window, in order to simplify the work with my app. ...
    (microsoft.public.vb.general.discussion)