GlobaLevel
asked on
vb.net read results from a command line and paste int an array
I have a process that runs by vb.net through the dos command line..and each time it goes through the loop it needs to print an array.. any ideas/?
The command line arguments are alread passed as an array.
Module Module1
Sub Main(ByVal args() As String)
Dim i As Integer
While i < args.Length
Console.WriteLine(i.ToString() & ": " & args(i))
i = i + 1
End While
End Sub
End Module
ASKER
its not in the breadcrumb above..I am using vb.net...the vb.net will call a command line..thur process.start? and launch a program to run via dos..then it will run varaibles against it and that will produce a result which will then need to be inputed into a an array variable.....then..this is extra ..will be sent to a remote db for storage...
Hi GlobaLevel,
Sorry but than I do not understand what your question.
The variable 'args' in the code above is an array.
Sorry but than I do not understand what your question.
The variable 'args' in the code above is an array.
ASKER
sorry..I must not be clear...
I am using vb.net to run a shell command against the DOS....the short is I need to glean the results from that and insert into variables...would this stil do?/
Module Module1
Sub Main(ByVal args() As String)
Dim i As Integer
While i < args.Length
Console.WriteLine(i.ToStri ng() & ": " & args(i))
i = i + 1
End While
End Sub
End Module
I am using vb.net to run a shell command against the DOS....the short is I need to glean the results from that and insert into variables...would this stil do?/
Module Module1
Sub Main(ByVal args() As String)
Dim i As Integer
While i < args.Length
Console.WriteLine(i.ToStri
i = i + 1
End While
End Sub
End Module
If I understand it correctly. You start a .net-application from the DOS-prompt with parameters.
You want to read those parameters into variables for further use in your application.
You want to read those parameters into variables for further use in your application.
Imports System.Windows.Forms
Module Module1
Public Sub main()
Dim frm As New Form1
Dim str() As String
Dim args() As String = Split(Command$," ")
If (UBound(str) >= 0) Then
a = str(0).ToString
b = str(1).ToString
End If
Application.Run(frm)
End Sub
End Module
ASKER
Dhaest~
I use vb.net to open a shell or MyProcess.start command....
Open an app with the shell that is using a vb.net
then read those values that are coming form the shell into varaibles...to be used in other parts of my vb.net program...
I use vb.net to open a shell or MyProcess.start command....
Open an app with the shell that is using a vb.net
then read those values that are coming form the shell into varaibles...to be used in other parts of my vb.net program...
ASKER
vb.net~~
open DOs with Shell or MyProcess
open app
dos returns values
save values into a varaibles
close shell
vb.net ~ takes those varibles into other parts of the vb.net program...
open DOs with Shell or MyProcess
open app
dos returns values
save values into a varaibles
close shell
vb.net ~ takes those varibles into other parts of the vb.net program...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What exactly do you want to do ? Run the program and from within the program printing/displaying information on the console-screen ?