Unable to UserAuthenticate (General questions)
I recently purchased this control and am thoroughly impressed with it, but at this moment I can't so a simple username / password. Even if I hard code the username and password into the code, It returns with not authorized page. I'm using the example that includes scripting that came with the control as a test bed and if anyone could point me in the right direction as to what I'm doing wrong, I would greatly appreciate it.
[code]
Option Explicit
Dim WithEvents Web1 As wodWebServerCom
Private Sub Form_Load()
Set Web1 = New wodWebServerCom
Web1.Authentication = AuthRequired
Web1.AuthenticationType = AuthBasic
Web1.Port = 80
Web1.Start
End Sub
Private Sub Web1_RequestHeaders(ByVal User As WODWEBSERVERCOMLib.IWebUser)
Dim a As String
Debug.Print Received headers from user & User.RemoteIP
' prepare outgoing file
User.Response.FileName = App.Path & index.htm
User.Response.StatusCode = OK
' set up scripting
User.Response.ScriptBegin = <
User.Response.ScriptEnd = >
' now when page is opened, RunScript event will fire
End Sub
Private Sub Web1_RunScript(ByVal User As WODWEBSERVERCOMLib.IWebUser, ByVal ScriptData As String, ResponseData As String)
If ScriptData = HOSTNAME Then ResponseData = User.RemoteIP
If ScriptData = DATE Then ResponseData = Now
End Sub
Private Sub Web1_StateChange(ByVal User As WODWEBSERVERCOMLib.IWebUser, ByVal OldState As WODWEBSERVERCOMLib.StatesEnum)
Debug.Print State changed to & User.StateText
End Sub
Private Sub Web1_UserAuthenticate(ByVal User As WODWEBSERVERCOMLib.IWebUser, ByVal AuthType As WODWEBSERVERCOMLib.WebAuthenticationTypes, Action As WODWEBSERVERCOMLib.WebActions)
If User.Login = test And User.Password = test Then
Action = Allow
Else
Action = Deny
End If
End Sub
Private Sub Web1_UserConnected(ByVal User As WODWEBSERVERCOMLib.IWebUser, Action As WODWEBSERVERCOMLib.WebActions)
Debug.Print User from & User.RemoteIP & connected
End Sub
Private Sub Web1_UserDisconnected(ByVal User As WODWEBSERVERCOMLib.IWebUser)
Debug.Print User from & User.RemoteIP & disconnected
End Sub
[/code]