Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a unique filename
Message
From
04/01/2004 12:54:32
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00863432
Message ID:
00863711
Views:
11
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform