|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to run and communicate a DOS program file in a VB.NET program?I has a vb.net program. For user requirement, I need to run and communicate an old DOS execution file. But, how to run and communicate a DOS program in a VB.NET program? Should I use the Process or Console class? How to do that? For example, If this DOS program name as "pick.exe". In DOS SHELL, user run the pick.exe then type "command1" and wait to response1 message. type "command2" and . When user receives the response1 message then type "command2" and wait to receive response2 message, later, user closes the DOS SHELL window. welcome to pick.exe v1.23 ------------------------- command1 .......... response1 message command2 .......... response2 message Thank you very much. Joe "tsung-yu" <tsung***@hotmail.com> schrieb: See:> For user requirement, I need to run and communicate an old DOS execution > file. > But, how to run and communicate a DOS program in a VB.NET program? > Should I use the Process or Console class? How to do that? <URL:http://dotnet.mvps.org/dotnet/samples/misc/RedirectConsole.zip> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Here is an example, of how to write and get input from the console program.
Module Module1 Sub Main() Dim myNum As Double Do While getNumber(myNum) myNum *= 10 Console.WriteLine("That number multiplied by 10 = " & myNum.ToString) Loop Console.WriteLine("Thank you for using the calculator!") Console.ReadLine() End Sub Function getNumber(ByRef myNum As Double) As Boolean Dim myVal As String Console.WriteLine("Please enter a value between 1 and 10 ") myVal = Console.ReadLine If Not IsNumeric(myVal) Then Console.WriteLine("That was NOT a number !") Return False Else myNum = CType(myVal, Double) Return True End If End Function End Module End Module Show quoteHide quote "tsung-yu" <tsung***@hotmail.com> wrote in message news:ePKX55QEHHA.3576@TK2MSFTNGP03.phx.gbl... > > > > Hello any expert, > > I has a vb.net program. > For user requirement, I need to run and communicate an old DOS execution > file. > But, how to run and communicate a DOS program in a VB.NET program? > Should I use the Process or Console class? How to do that? > > For example, > If this DOS program name as "pick.exe". > > In DOS SHELL, user run the pick.exe then type "command1" and wait to > response1 > > message. > type "command2" and . > When user receives the response1 message then type "command2" and wait to > > receive response2 message, later, user closes the DOS SHELL window. > > welcome to pick.exe v1.23 > ------------------------- > command1 > ......... > response1 message > command2 > ......... > response2 message > > > Thank you very much. > Joe > >
Why is this simple addition throwing an overflow exception?
calling math functions at run time regarding .net help Good book for an absolute beginner on VB.net or 2005 with databases newbie: foundfile attributes? (filesize, saved date, etc.) Can someone please translate this to VB.Net Problem saving txt box with enter key Opening...Closing Forms WIALib error need help with 1 line of code now! |
|||||||||||||||||||||||