Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check login page

Status
Not open for further replies.

siumouse

Programmer
Aug 27, 2003
12
0
0
HK
I have write a ASP using ImpersonateUser method to valid the use login and password, the code is shown at below:

Set oLogin = Server.CreateObject("001.ImpersonateUser")

If not oLogin.IsValidLogon(cEmpNo, cEmpPwd, cDomain) then
cMsg = "Incorrect password."
else
cMsg = "Correct password."
End if

But My boss complain that the page is needed a very long time to check when the input password is incorrect.

How to solve the problem ?
 
If you gonna use the Users on your server to login why not use the integrated IIS or NTFS user pages access?

Disable Anonimous logon to that IIS folder and Enable Integrated Windows Authentication. Then Add only the users you want to have access at those files in the NTFS security pannel (you can create a group).

________
George, M
 
Thank George comment,

But how to can set a verfiy time on login page
(e.g loading a page over 8 sec, display a Time out message)
 
I think you can do something like this
Code:
<%
'turn off bufering
Response.Buffer=false
%>
<script>
function timeout()
{
 document.location='timeout.asp';
}
//start the timer here
var tmr=window.setTimeout(timeout,8*1000)
</script>
<%
I have write a ASP using ImpersonateUser method to valid the use login and password, the code is shown at below:

Set oLogin = Server.CreateObject(&quot;001.ImpersonateUser&quot;)

If not oLogin.IsValidLogon(cEmpNo, cEmpPwd, cDomain) then
   cMsg = &quot;Incorrect password.&quot;
else
   cMsg = &quot;Correct password.&quot;
End if
%>
<script>
//stop the timeout page if loaded in 8 secs
window.clearInterval(tmr)
</script>

________
George, M
 
I write a program for testing:

<% Response.Buffer = false %>

<script language=&quot;JavaScript&quot;>
function timeout()
{
alert('Time out!');
document.location='no.asp';
}

var tmr=window.setTimeout(timeout, 8*1000)
</script>

<% call delay01 %>

<script language=&quot;JavaScript&quot;>
window.clearInterval(tmr)
</script>
<html>
<body>
<h1>This is a Testing page</h1>
</body>
</html>
<%
Function delay01
Dim nX, nY, n1

For nX = 1 to 9999
for nY = 1 to 99
Response.Write &quot;nY=&quot; & cstr(nY) & &quot; nX=&quot; & cstr(nX) & &quot;<br>&quot;
Next
Next
End Function
%>


The result of testing, the page can display the message, but cannot redirect to no.asp after 8 sec.
How to solve the problem ?
smiletiniest.gif
 
This is weird, the first code should arived to the client. Try again and take a look at the white page source code see if the script it's there.

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top