Passing a variable from a form to a console...
Passing a variable from a form to a console...
(OP)
Hi,
I've written a form application in VB 2010 that defines a variable, and then runs a console application. I need to pass that single variable (which is a string) from the form application to a console application, (which is a separate program, not a console within the same project). I need then to use that variable in the console app to carry out further operations.
If anyone could help me out I would much appreciate it.
Thanks
I've written a form application in VB 2010 that defines a variable, and then runs a console application. I need to pass that single variable (which is a string) from the form application to a console application, (which is a separate program, not a console within the same project). I need then to use that variable in the console app to carry out further operations.
If anyone could help me out I would much appreciate it.
Thanks
RE: Passing a variable from a form to a console...
For anyone who wants to know, use the following in app 1:
dim newprocess as new process()
newprocess.startinfo.filename = "Filelocation"
newprocess.startinfo.arguments = "variable"
newprocess.start()
then in the second application, use:
dim argumentsplit() as string
dim variable as string
for each argument as string in My.Application.CommandLineArgs
argumentsplit = argument.split("symbol")
variable = argumentsplit(0)
next
cheers