How can i get VB.NET to automatically phrase all parameters except the first using "-"?
For example:
I want the first parameter not to need a "-", But all parameters after this must start with a "-".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 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?




Reply With Quote