Jump to content

Make the Program Check Later after done Executing

- - - - -

  • Please log in to reply
1 reply to this topic

#1
UnknownKnowledge

UnknownKnowledge

    Newbie

  • Members
  • Pip
  • 7 posts
I have been trying to get this one line of code to work for the past hour and I'm starting to get frustrated, so I thought maybe someone else had a similar problem before and would be able to help.

So the problem is that the program is checking the conditional statement before I want it to, plane and simple.

I am making a login system that will redirect back to the login page if the login failed but will let it continue if the login was a success. I did this by having a timer go for 10 seconds after the user presses login, because the transition page and the failed login page are the same url. I have the timer counting down from 10 when the user presses login then it transfers to textbox7. So I have a If-And-Then statement saying that if it goes to the transition page and stays there for 10 seconds it must mean that the login failed because if it didn't it would go to a different page.

The code looks like this:
If Login.Url.ToString = "http://site.org/forum/member.php" And TextBox7.Text <= 0 Then
MessageBox.Show("Login did not work, Please try again", "Login")
Login.Navigate("http://site.org/forum/member.php?action=login")
End If

I've been messing around with the code and if I change the order in which the events happen it makes the message saying that the login didn't work. So I've came to the conclusion that the event for checking whether the login failed or not is coming too soon. I am not sure how to do this, I thought I could make it so that when textbox7.text = 0 then it would check it by making a private sub, but it didn't work. I am not sure what else to do, if someone would be able to help me I would highly appreciate it. Thanks for your time.

#2
UnknownKnowledge

UnknownKnowledge

    Newbie

  • Members
  • Pip
  • 7 posts
I no longer need this, I switched to web requests, there was a problem with the time the web page responded and the code. It couldn't be solved so I switched to an HTTP Web Request login system.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users