Connecting Tech Pros Worldwide Forums | Help | Site Map

passing parameter....

Joe Smith
Guest
 
Posts: n/a
#1: Nov 21 '05
How to pass parameter to a Vb.Net application?
..Net Framework 1.1.
Thanks,
Joe



Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 21 '05

re: passing parameter....


"Joe Smith" <Joe_H_Smith@hotmail.com> schrieb:[color=blue]
> How to pass parameter to a Vb.Net application?[/color]

Add this code to a module file and select 'Sub Main' as startup object in
the project properties:

\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
Console.WriteLine(Arg)
Next Arg
End Function
End Module
///

Starting an application and passing parameter to the started application:

\\\
Imports System.Diagnostics
..
..
..
Process.Start( _
"mysearch.exe", _
"""searchthis string"" ""inthisfile.txt""" _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Closed Thread