Hi all, i have quick doubt it will be helpful to resolve the issue. i need to generate random Number without repitative the Number in index - 6 digits.
is the request about unique random numbers with a length of 6 or
create all possible combinations of 6 digits length number without any repeated digit
Any set size limit or fully completed?
Hi ppr without repetative we need random number. like for example 123456 this is fine for our case. 122456 this is we don’t need.
New Random().Next(100000,999999).ToString this will generate a random number with 6 digits, but there is a possibility for digits repeating with in the 6 digits.
what you can do is,
use num = New Random().Next(0,9).ToString to generate 6 digits separately (u can use while loop) and check if there are any repeat numbers and join all the 6 digits if no repeated digits
if there is a repeat digit regenerate that digit and finally join it
hope this is helpful
질문에 맞는 소스인지 확인해보세요
샘플코드_숫자_랜덤_비동일6자리.xaml (6.5 KB)
thanks for answer
654321, 213456 will it be included as well into the set?
How much numbers do you want get generated? 10, 100 all possible combinations?
Thanks for your quick reply @peter. I got the solution now. Thanks for your response
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.