Question Passing Parameter to Applicatio

moody_4u

Member
Joined
Aug 13, 2008
Messages
5
Programming Experience
Beginner
Hey all,

how can i pass parameter to my project at the run time,

the code is
------------------------------------
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "c:\somefile.pdf"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
------------------------------------

so i want to send the value of (p.FileName) at the run time
like this

cmd > myApplication.exe "c:\somethingElse.pdf"

i wish it's clear 4 u


thx in advance
 
VB.NET:
Dim Args() As String = Environment.GetCommandLineArgs
For Each Arg As String In Args
  Select Case Arg.ToLower
    Case "your_arg"
      'Do something
  End Select
Next Arg
 
thank you for your fast reply

but i didn't get the code clear

the value which i wanna pass isn't fixed

i wanna pass file names so i don't know them

can u explain it for me sorry but i'm newbie


thx again
 
thx again, i got around it

VB.NET:
Dim Args() As String = Environment.GetCommandLineArgs


        'Dim p As New System.Diagnostics.ProcessStartInfo()
        'p.Verb = "print"
        'p.WindowStyle = ProcessWindowStyle.Hidden
        'p.FileName = Args.ToString
        'p.UseShellExecute = True
        'System.Diagnostics.Process.Start(p)
        MsgBox(Args(1))
thx Mr.JuggaloBrotha again
 
Back
Top