Asp.net version of the password generated by the random function

Source: Internet
Author: User

Http://www.asp888.net bean curd technology station

Asp.net version of the password generated by the random function

We often generate random passwords in the process of using asp. This is very simple.
In the process of asp +, I tried to use the same method out of inertia, but unfortunately
It is a Replease version. Although Randomize and Rnd functions are used in help, they have been debugged
In the process is always unable to pass, it seems that in the official version of the MS should be supported, now what to do, is it...

No, tofu resolutely said to myself: after a review of the efforts, I finally found another method, there is one in asp +
Random object, so I came up with this program.
<% @ Page language = "VB" %>
<% @ Import namespace = "System. Random" %>
<Script language = VB runat = server>
Function GetRndPass
Dim intRnd as new Random
Dim strTemp as string
Dim I as integer
For I = 0 to 6
I = intRnd. Next (0, 9)
StrTemp = strTemp + cStr (I)
Next
End function
</Script>
In this way, we get a 7-bit password, and then refer to our previous article asp + complete Email sending manual, we can generate a random password based on the user
Enter the Mail address to mail the password out.


Related Article

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.