[RESOLVED] [2008] Command Line Parameters Problems
How can i get VB.NET to automatically phrase all parameters except the first using "-"?
For example:
Code:
Dim ArgsCollection As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs
If ArgsCollection.Count >= 1 Then
For Each arg As String In ArgsCollection
File_Path = arg
Exit For
Next
End If
I want the first parameter not to need a "-", But all parameters after this must start with a "-".
I want to do this because i want to pass file names into my application (With spaces) so the files can be opened, but then i may wish to pass "-Maximized" or "-Readonly" after the filename. It's a notepad type of application i.e. Only one file at a time and not multiple files at a time (Just like notepad).
What would be the best way to accomplish this?
Re: [2008] Command Line Parameters Problems
Code:
Dim ArgsCollection As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs
If ArgsCollection.Count >= 1 Then
For Each arg As String In ArgsCollection
File_Path = File_Path & " " & arg
Next
Dim ArgSplit() As String
ArgSplit = Split(File_Path, "/")
If ArgSplit.GetUpperBound(0) >= 1 Then
File_Path = ArgSplit(0)
Don't worry...