User Registration

If you have purchased a developer license, the Visual Basic Ecco Toolkit provides support for user registration.  This is accomplished using the Register method of the EccoApp object. 

This method takes four parameters: (1) your unique developer ID, (2) a user ID, (3) a user name, and (4) an expiration date.  The first of these is required.  The others are optional, and your project can specify which ones are required, depending on the degree of user authentication required.

The Register method should be called immediately after initializing the EccoApp object; none of the other Ecco objects will function unless this method has been successfully called.  (To check whether registration was successful, confirm that the Registered property returns True.)

Safeguard your Developer ID!  Should someone else obtain access to your developer ID, they will be able to use it to generate valid user ID's for your applications.

The Register function is flexible and permits various forms of user authentication:

Freeware

Set User ID and User Name to -1.  As long as your developer ID is valid, registration will be successful.  For example:

Dim MyEcco as EccoApp 
Set MyEcco = New EccoApp
DeveloperID$ = "xxxxxxxx" 'Substitute your developer ID
EccoApp.Register DeveloperID$, -1, -1 

Time Limited

Set the desired expiration date.  Registration will be successful until that date but will fail afterwards.  For example:

Dim MyEcco as EccoApp 
Set MyEcco = New EccoApp
EccoApp.Register DeveloperID$, 0, 0, #12/31/2001# 

User Registration Codes

Set User ID and User Name.  Every User Name has a unique User ID which will allow successful registration.  Use the GetUserID function to get the valid User ID associated with a particular user name and developer ID.  You can use that function in a program to generate user ID's for registered users.  Your program's user interface can prompt the user to enter a user ID and user name, and if registration is successful your program can store that information in the Registry.  For example:

Dim MyEcco as EccoApp 
Set MyEcco = New EccoApp
UserID$ = GetSetting ("ABC Software", "ABC Widget", "User ID")
UserName$ = GetSetting ("ABC Software", "ABC Widget", "User Name") 
EccoApp.Register DeveloperID$, UserID$, UserName$ 
If EccoApp.Registered = False then 
    MsgBox "Invalid Registration!"
    End
End If

Password Authentication

As a variation of the above, your program can prompt the user to enter the User Name and User ID every time, thus providing a rudimentary form of password protection.  For example:

Dim MyEcco as EccoApp 
Set MyEcco = New EccoApp
UserID$ = InputBox "Enter User ID:"
UserName$ = InputBox "Enter User Name:"
EccoApp.Register DeveloperID$, UserID$, UserName$ 

Combinations

Your application can use a combination of the above.  For example, your program can test for a valid user name and user ID.  If these are not supplied, your program could alternatively register using the first method above, but allow reduced functionality; or could register using an expiration date.  For example:

Dim MyEcco as EccoApp 
Set MyEcco = New EccoApp
UserID$ = GetSetting ("ABC Software", "ABC Widget", "User ID")
UserName$ = GetSetting ("ABC Software", "ABC Widget", "User Name") 
If UserID$ = "" then
    FirstTime = True
    UserID$ = InputBox "Enter User ID:"
    UserName$ = InputBox "Enter User Name:"
End If
MyEcco.Register DeveloperID$, UserID$, UserName$ 
If EccoApp.Registered then
    If FirstTime = True then
        SaveSetting "ABC Software", "ABC Widget", "User ID", UserID$
        SaveSetting "ABC Software", "ABC Widget", "User Name", UserName$
    End If
Else
    MyEcco.Register DeveloperID$, 0, 0, #12/31/2001#
    MsgBox "This unregistered software will function until December 31, 2001."
End If