Solution 1 is providing you with pseudo-random numbers and should really have warned you about the implications of that (e.g. you could end up with duplicates). See the documentation for further information
Random Class (System) | Microsoft Docs[
^]
You would probably be better off using the
RNGCryptoServiceProvider Class[
^]. There are examples of how to do that on that link.
Once you have your random number
r
you can generate your bank account number with
string accNumber = String.Format("32{0}", r.ToString("D6"));
Now note the comments from @ppolymorphe and @George-Swan - Bank Accounts are not just random numbers, they follow very specific rules. Once you have generated your number you should check that it is valid.
Here is a clickable version of George's link
https://www.vocalink.com/media/1733/vocalink-validating-account-numbers-v350.pdf[
^]
Here is another example of a validation tool
Sortcode and Bank Account Validation - C# Developers Guide[
^]
And here is a Codeproject article on the subject
IBAN Validator[
^]
There are many commerical products and APIs available to do the validation.