Reading an argument given to the program when started

  • Thread starter Thread starter Joris De Groote
  • Start date Start date
J

Joris De Groote

Hi

I am busy trying to create a VB.NET program. I want to give the program an
argument in the shortcut I created for that program (for example:
program.exe argument).
Now I just can't find how I can read that argument in my VB.NET program.

Can anyone help me?

Thanks
Joris
 
Try Environment.GetCommandLineArgs or Environment.CommandLine

/claes
 
public class MyProgram


public shared Sub Main(args() as string)

'args contains an array of strings representing the command line


dim mainForm as new MyForm(args)

Application.Run(mainForm)


end


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

Back
Top