help with command line arguments in program - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help with command line arguments in program

jeffmanjeffman Posts: 112Member
Hello Everyone, It has been a few months since i was last here. Can anyone help me figure out how to code my program so i can get a command line argument out of the code. Here is the code so far i have been attempting to work with so far:
Dim arguments(999) As String
For Each argument As String In My.Application.CommandLineArgs
MsgBox("argument:" + argument)
MsgBox("length of argument:" + argument.Length.ToString, MsgBoxStyle.Information)


now, the argument varible has the command line switch and path together and i want to do case statements. In addition, i want to seperate the command line switch from the argument data. the last sentence is the part i really want to get done though.

Select Case argument
Case Is = "/l=" + argument.Substring(4, argument.Length)
argument = argument.Remove(0, 3)
If argument.Length > 3 Then
inputName = argument
If argument.Length > 3 Then
TimerFileName = argument
MsgBox("filename:" + argument)
OpenTempSettings()
End If
End If
Case Is = ""
End Select


MsgBox("argument2:" + inputName, MsgBoxStyle.Information)

'TimerFileName = inputName
'OpenTempSettings()

Next

If inputName = "" Then
MsgBox("No input name")
Else
MsgBox("Input name: " & inputName)
Sign In or Register to comment.