A simple experience.

Source: Internet
Author: User
There's a lot of land on the site that has been used for the test, and it's a simple one to watch for fun (well, it's going to have to be written to the picture, it's a bit hard, it hasn't been studied) first.
Sub Page_Load (sender as object,e as EventArgs)
If not IsPostBack Then
Dim Rannum as Random=new random
' writes the generated random numbers into the label
Lblrannum.text=rannum.next (1111,9999). ToString
End If
End Sub

Sub Btnok_click (sender as object,e as EventArgs)
Dim strtemp as String=lblrannum.text.tostring
' Check that the number entered in the TextBox is consistent with the test code, and that the same is OK, otherwise the error
If Strtemp=trim (Txtnumber.text) Then
lblmessage.text= "ok!"
Lblrannum.text=rannum.next (1111,9999). ToString ' If you don't write this, the test code will always be the first time you have to load the leaf surface.
Else
lblmessage.text= "error!"
Lblrannum.text=rannum.next (1111,9999). ToString
End If
End Sub
<body>
<form runat= "Server" >
<asp:textbox id= "Txtnumber" runat= "Server" ></asp:textbox>
<asp:button id= "Btnok" runat= "Server" text= "OK" ></asp:button>
<asp:label id= "Lblrannum" runat= "Server" ></asp:label>
<asp:label id= "lblmessage" runat= "Server" ></asp:label>
</form>
</body>
-------------------------------------------------------------------------
The security of this test is not very good. The site is usually written to the test on the picture, that security is much better, even if the hacker to see is the password.
But I don't write ... I'm going to have to study it slowly!



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.