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!