In this article, I will show you how to generate OTP digits in ASP.NET C#. By using the random class we can generate any number length digits in OTP.