Results 1 to 4 of 4

Thread: Command arguments

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Manila, Philippines
    Posts
    59

    I want to create a program that can be called with or without arguments just like ms-dos commands. (ex. chkdsk /f)

    The arguments are actually login id and password. The program will check if arguments are supplied and then login accordingly. On the otherhand, if the user did not supply the arguments, the program will show a dialog box.

    My only problem here is the passing and reading of arguments.

    tnx.


    using VB 6.0 Enterprise Edition SP3

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Smile

    Assume the ValidatePwd is your function to check the input user id and password is match with those you have in the user database and the code just like below:

    Code:
    Public Sub Main()
    Dim MyCmdLine As String
    MyCmdLine = Command()
    
    If Len(MyCmdLine) <> 0 Then
        If ValidatePwd Then
            Load frmMain
            frmMain.Show
        Else
            MsgBox "Invalid user id or password."
        End If
    Else
        MsgBox "Invalid command line."
        Load frmMain
        frmMain.Show
    End If
    End Sub

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    To make it not required all the time

    Code:
    If Command() = "" Then Goto NoCOm:



  4. #4

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Manila, Philippines
    Posts
    59
    thank you very much guys! that's a great help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width