Login    
 
 
 
 
Text/HTML
  
You are here :: Blogs Saturday, May 19, 2012

Search
Note: This uses the internal blog search engine. The Google search engine is also available at the top of the page.
  
Disclaimer

Please review the site disclaimer before downloading or using content found on this site

  
Categories
  
DEVSHED Blog
As always, I welcome your comments!
Jun 21

Written by: Steve Gray
6/21/2010 8:23 AM  RssIcon

Here is a VB.NET class that shows how to process arguments for a console app

Create a console app, and in the project properties click on DEBUG, then specify something in the 'Commant Line Arguments' area. For the sample app, you might put 'olap diskspace' and those two items will be processed.

Once you build and deploy the app, you would call the app like this: MYAPP.EXE OLAP DISKSPACE, where OLAP and DISKSPACE are my example arguments

 

Module Module1
    Sub Main(ByVal args() As String)
        'can be called with three args:
        'OLAP - runs the olap scrips
        'DISKSPACE - checks the disk space
        'BACKUP - runs a file copy routine
        Dim a As Int16
        If args.Length = 0 Then
            Exit Sub
        End If
        For a = 0 To args.Length - 1
            Select Case args(a).ToUpper
                Case "OLAP"
                    processOLAP()
                Case "DISKSPACE"
                    processDISKSPACE()
                Case "BACKUP"
                    processDISKSPACE()
            End Select
        Next
    End Sub
    Sub processOLAP()
    End Sub
    Sub processDISKSPACE()
    End Sub
    Sub processBACKUP()
    End Sub

Tags:
Categories:
As always, I welcome your comments!
  
 
 
Home | Products | Blogs | Contact Us | Links | God's Plan
Privacy Statement | Terms Of Use
 
Copyright 2011 by Devshed.us