Testing Command Line Arguments For Values
This snippet explains how you can test for command line arguments if they have been executed with the VB.NET application.
' Loop through all the command line arguments given.
For I As Integer = 0 To My.Application.CommandLineArgs.Count - 1
' If an argument equals /m
If My.Application.CommandLineArgs.Item(I) = "/m" Then
MsgBox("You have used /m!")
Else ' If it doesn't equal "/m"
MsgBox("Incorrect CMD Argument.")
End If
Next
See Also
Dream In Code Submission - http://www.dreamincode.net/code/snippet1442.htm
page_revision: 0, last_edited: 1195463464|%e %b %Y, %H:%M %Z (%O ago)





