|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reading an argument given to the program when startedHi
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 Show quoteHide quote "Joris De Groote" <joris.degro***@skynet.be> wrote in message news:euQYtaLVGHA.6084@TK2MSFTNGP14.phx.gbl... > 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 > 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 |
|||||||||||||||||||||||