-
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
-
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
-
To make it not required all the time
Code:
If Command() = "" Then Goto NoCOm:
:)
-
thank you very much guys! that's a great help.