A simple verification code

xiaoxiao2021-03-06  110

There are many logins on the website to use the verification code. Look at the fun yourself and have written a simple (better, you have to write the verification code to the picture, a little difficult, haven't studied) first. SUB Page_Load (Sender As Object, E AS Eventargs) if not ispostback the Dim Rannum as random = new random 'Write the generated random number to lablrannum.text = rannum.next (1111,9999) .tostring end ifend subsub BTNOK_CLICK (Sender AS Object, EVENTARGS) DIM STRTEMP AS STRING = LBLRANNUM.TEXT.TOSTRING 'Check if the number entered in TextBox and whether the resulting verification code is consistent, the same is OK, otherwise Error if straTemp = TRIM (txtnumber. TEXT) THEN LBLMESSAGE.TEXT = "OK!" LBLRANNUM.TEXT = RANNUM.NEXT (1111, 9999) .Tostring 'If this sentence is not written, the resulting verification code has been the verification generated when the leaves are first loaded. Code else lblMessage.text = "Error!" Lballnum.text = rannum.next (1111,9999) .tostring end ifenet sub

-------- --- -------------------------------------------------- ------------ This verification code is not very good. We generally write the verification code to the picture, which is much better, even if the hacker is intercepted It is also garbled. But I won't write ... I have to study slowly! Sorry

转载请注明原文地址:https://www.9cbs.com/read-100603.html

New Post(0)