vendredi 24 mars 2017

Why I am getting 0 in value. I have debugged it and found I am getting 0 in value. Also when i am storing to database it also store 0

I am trying to generate random number using RNGCryptoServiceProvider, but some how I am getting o(Zero) in return

private string generatePassword()
{

    using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
    {
        string value = string.Empty;
        byte[] randomnumber = new byte[10000];
        rng.GetBytes(randomnumber);
        value = randomnumber.Tostring();
        return value;
    }

}




Aucun commentaire:

Enregistrer un commentaire