"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:em**************@tk2msftngp13.phx.gbl...
"Brett" <no@spam.com> schrieb: How do I receive command line parameters being passed into my
application? Say I call the application from within MS Access and it
passes me an ID. How do I receive the ID in the VB.NET app?
\\\
Public Module Program
Public Sub Main(ByVal Args() As String)
For Each Arg As String In Args
Console.WriteLine(Arg)
Next Arg
End Sub
End Module
///
Select 'Sub Main' as startup object in the project properties.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
The above way is the preferred way...C-Style way as well. Here is another
way :)
Public Module Program
Public Sub Main()
Dim args As String() = Environment.GetCommandLineArgs()
For Each arg As String In args
Console.WriteLine(arg)
Next
End Sub
End Module
Just so you know, there is always more than 1 way to do things ;)
Mythran