Wednesday 8 June 2016

OTP_CODE GENERATION IN C#

 public string OTP_CODE()
    {
        var nums = "123456789";
        var random = new Random();
        string otp = new string(
            Enumerable.Repeat(nums, 4)
                      .Select(s => s[random.Next(s.Length)])
                      .ToArray());
        return otp;
    }

No comments:

Post a Comment