Top Ad unit 728 × 90


how to generate random password in c#

 how to generate random password in c#

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 using c#,c# password generator alphanumeric, identity generate random password,.net core generate password,.net core generate random password, core generate random password

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

Go for  Client side Multiple parameter post :


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());

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


  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.

  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


All Rights Reserved by © 2018

Contact Form


Email *

Message *

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