Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a unique filename
Message
De
04/01/2004 12:54:32
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00863432
Message ID:
00863711
Vues:
10
>Michaels suggestion will work but it creates nasty filenames <g>... A couple of things you can do to make that a little cleaener:
>
>Use:
>
>
>Path.GetTempFileName()
>
>
>which returns a filename and creates a 0 byte file (which seems lame, but it maps the underlying API call).
>
>You can use Michaels idea and use a Hash on it to make it more managable:
>
>
>(new Guid()).ToString().GetHashCode().ToString("x");
>
>
>This will return a hex representation of hte hash that's somewhere around 8 =12 characters long usually.
>
>Actually the Temp API uses something very similar to return filenames.

Thanks Rick, I will also take a look at those enhancements.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform