Passing parameter from one exe to another

vibhawari

New member
Joined
May 20, 2008
Messages
1
Programming Experience
1-3
I have to pass parameters from one exe to other exe of vb.net. Second applicaion must receive the parameter in constructor.

I am calling the second exe from first application the code is -
Process.Start("D:\Test1\Test1.exe", "Tesing Application")


Constructor in second application is -

Public Sub New(ByVal newParameter As String)
'MyBase.New()
InitializeComponent()
p1 = newParameter
End Sub


But "Testing Application" parameter is not able to read thro' second application.
How can i send it to second application and how can i receive it?
 
You don't need to create a constructor with parameters (it is also not used on app start), use Environment.CommandLine (a String) or Environment.GetCommandLineArgs (an array of String). There is also e.CommandLine info in application events Startup and StartupNextInstance.
 
Back
Top