This C# library will help you to generate random pincodes.
Below is shown how to use PinCode class to generate pincodes.
int pinCodeLength = 25;
PinCode pinCode = new PinCode(pinCodeLength, PinCodeType.AlphaNumericWithSymbols);
string newPinCode = pinCode.Generate();
int pinlenght = 15;
PinCode pin = new PinCode(pinlenght, PinCodeType.Numeric);
string newpin = pin.Generate();
Here is standalone .dll file.
You can clone it with this link https://github.com/gkhachatryan/smartpincode.git