VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

 

Code Snippets

  

VB.NET Source Code


Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 340,161 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 4,026 people online right now. Registration is fast and FREE... Join Now!




Testing Command Line Arguments For Values

Supports multiple argument checking for values appended to the end of the application name, e.g Test.exe /m

Submitted By: RodgerB
Actions:
Rating:
Views: 1,295

Language: VB.NET

Last Modified: January 1, 1970
Instructions: 1) Copy the code provided into a subroutine.
2) Edit the code to meet your purpose.

Snippet


  1. ' Loop through all the command line arguments given.
  2. For I As Integer = 0 To My.Application.CommandLineArgs.Count - 1
  3.     ' If an argument equals /m
  4.     If My.Application.CommandLineArgs.Item(I) = "/m" Then
  5.         MsgBox("You have used /m!")
  6.     Else ' If it doesn't equal "/m"
  7.         MsgBox("Incorrect CMD Argument.")
  8.     End If
  9. Next

Copy & Paste


Comments

There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month