The logon process, 10 c – Kofax DM API User Manual
Page 30

10
C
HAPTER
1
The Logon Process
Dim lim As Long
Dim LoginType As Integer
Dim emsg As String
If (NetworkType = "Network Bindery") Then
LoginType = 1
ElseIf (NetworkType = "Network NDS") Then
LoginType = 2
ElseIf (NetworkType = "Microsoft Network") Then
LoginType = 8
Else
LoginType = 0
End If
If (Domain.Text <> "" And LoginType <> 0) Then
'The Network and Domain are specified, so
'log on to the network.
login.AddLogin LoginType, Domain.Text, _
txtUserName.Text, txtPassword.Text
Else
'Just log on as a Library user.
login.AddLogin 0, library, _
txtUserName.Text, txtPassword.Text
End If
OK = (login.ErrNumber = 0)
If (OK) Then
login.Execute
OK = (login.ErrNumber = 0)
End If
If OK Then
'Set the public variables others will
'need and then hide.
library = login.GetLoginLibrary()
user = login.GetDOCSUserName()
group = login.GetPrimaryGroup()
dst = login.GetDST
Me.Hide
Else
'Unable to log on.
emsg = "Error logging on: " & _
login.ErrNumber & String(1, 13) & _
String(1, 10) & login.ErrDescription
MsgBox emsg, , "Logon"
txtPassword.SetFocus