Top Ad unit 728 × 90

random

how to generate random password in c# asp.net

 how to generate random password in c# asp.net


Below program show how to generate random password using c# console application. This program can be use anywhere to create the random password .


Tags |  how to generate random password in asp.net using c#,c# password generator alphanumeric,asp.net identity generate random password,.net core generate password,.net core generate random password,asp.net core generate random password


For more details about  random class you can use below site.


Go for  Client side Multiple parameter post :

Purpose

using this feature ,anyone can increase the security of a website by taking the process out of the hands of the user.
This tutorials show a simple password generation technique.


Generating random password is the another way of provide the secure login. it help to increase the security of site.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Generate_Randon_password
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Random myRandom = new System.Random();
            int myLength = myRandom.Next(6, 10);
            string myPassword = "";
            while (myPassword.Length < myLength)
            {
                int myPick = myRandom.Next(1, 3);

                if (myPick == 1)
                {
                    // Add a random number to the string.
                    myPassword += (char)myRandom.Next(48, 57);
                }
                else if (myPick == 2)
                {
                    // Add a random lower case letter to the string.

                    myPassword += (char)myRandom.Next(97, 122);
                }
                else if (myPick == 3)
                {
                    // Add a random upper case letter to the string.

                    myPassword += (char)myRandom.Next(65, 90);
                }
            }

            Console.WriteLine("Your Random PassWord is : "+myPassword.ToString());
            Console.ReadKey();
        }
    }
    }

















how to generate random password in c# asp.net Reviewed by Vikas Kumar Singh on December 14, 2017 Rating: 5

2 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.

    ReplyDelete
  2. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
    Advanced AWS Training in Bangalore | Best Amazon Web Services Training Institute in Bangalore
    Advanced AWS Training Institute in Pune | Best Amazon Web Services Training Institute in Pune
    Advanced AWS Online Training Institute in india | Best Online AWS Certification Course in india
    AWS training in bangalore | Best aws training in bangalore

    ReplyDelete

All Rights Reserved by DotNetBasic.com © 2018

Contact Form

Name

Email *

Message *

© 2018 All rights reserved by DotNetBasic. Powered by Blogger.