0

In some cases like uploading files from web application you need to create unique names.Because it is possible that different users can upload different or same files with same name and it is not allowed .

So sometimes we need to use such a function which will create us unique names/strings.

What are solutions ?

RASKOLNIKOV
  • 732
  • 2
  • 9
  • 20

1 Answers1

5

So lets start:

This is one of the solutions:

public static string CreateFileName()
{
    return Guid.NewGuid().ToString().Replace("-", ""); 
}
Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116
RASKOLNIKOV
  • 732
  • 2
  • 9
  • 20