locked
Starting up my application with costumized parameters RRS feed

  • Question

  • How do I start up my application with parameters like fileName or webPage?

    Friday, April 27, 2007 2:33 PM

Answers

  • Under the project settings.. set the startup object to "Sub Main"

     

    and then add a module to your project with a sub main:

     

    Module MainModule

     

    Public Sub Main(byval StartupParameter as String)

    'DoSomthing

    Application.Run(New MainForm) 'starts a form in your app

    'DO Cleanup

    End Sub

     

    End Module

    Friday, April 27, 2007 2:38 PM
    Moderator
  • Or use 

    Code Snippet

    System.Environment.GetCommandLineArgs

     

    to get the command line parameters...

     

    Best regards,

    Johan Stenberg

     

    Friday, April 27, 2007 9:44 PM
    Moderator

All replies

  • Under the project settings.. set the startup object to "Sub Main"

     

    and then add a module to your project with a sub main:

     

    Module MainModule

     

    Public Sub Main(byval StartupParameter as String)

    'DoSomthing

    Application.Run(New MainForm) 'starts a form in your app

    'DO Cleanup

    End Sub

     

    End Module

    Friday, April 27, 2007 2:38 PM
    Moderator
  • Or use 

    Code Snippet

    System.Environment.GetCommandLineArgs

     

    to get the command line parameters...

     

    Best regards,

    Johan Stenberg

     

    Friday, April 27, 2007 9:44 PM
    Moderator