문제

I need to generate unique folder names, should I use Path.GetRandomFileName or just use Guid.NewGuid?

Guids say they are globally unique, GetRandomFileName does not make such a claim.

도움이 되었습니까?

해결책

I think both are equally random, the difference being that Path.GetRandomFileName will produce a 8.3 filename (total of 11 characters) so is going to have a smaller set of unique names than those generated by Guid.NewGuid.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top