mattcottrell
Technical User
I am trying to create a html page which has a button on it which logs off the user.
The script works fine when I do it in VB6 but all I get is the message box when it is in the html page.
are there any limitations to what scripting you can use in html.
Here is the html script:
<HTML>
<HEAD>
<SCRIPT TYPE="text/VBScript">
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT TYPE="text/VBScript">
Sub Button1_OnClick
MsgBox "This will log you off"
Call ExitWindowsEx(EWX_LOGOFF, 0)
Unload Me
End Sub
</SCRIPT>
<H3>Log off test Page</H3><HR>
<FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Log Off"></FORM>
</BODY>
</HTML>
Many thanks in advance
Matt Cottrell
The script works fine when I do it in VB6 but all I get is the message box when it is in the html page.
are there any limitations to what scripting you can use in html.
Here is the html script:
<HTML>
<HEAD>
<SCRIPT TYPE="text/VBScript">
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT TYPE="text/VBScript">
Sub Button1_OnClick
MsgBox "This will log you off"
Call ExitWindowsEx(EWX_LOGOFF, 0)
Unload Me
End Sub
</SCRIPT>
<H3>Log off test Page</H3><HR>
<FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Log Off"></FORM>
</BODY>
</HTML>
Many thanks in advance
Matt Cottrell