Parameters on an Executable

G

Guest

Using VB.NET, I need to create an executable that will accept parameters.
This app will not have any user interface, I just want it called from another
app but I need to send some parameters in.

Can someone tell me how to do this?

Thanks!
 
A

alantolan

The main() function has a few overloads including ones that captures
the input parameters.

e.g.

Public Class myApp

#Region "Shared"

Public Shared Sub main(ByVal args() As String)

Dim app As myApp
Dim mainForm As myForm

Try

app = New myApp(args) ' passes the arguments
into the app class
mainForm = New myForm(app) ' creates the mainForm with a
reference the app class

Application.Run(mainForm)

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub

#End Region


End Class



hth,
Alan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top