cybeh
asked on
How to ensure System.IO.Path.GetTempFileName() will not give repeated filename?
Hi,
We will be using this method
System.IO.Path.GetTempFile Name()
to generate around 200 files inside a function. May I know how can we ensure that the file name are not repeated so that will will not be overwrite?
Please advice.
We will be using this method
System.IO.Path.GetTempFile
to generate around 200 files inside a function. May I know how can we ensure that the file name are not repeated so that will will not be overwrite?
Please advice.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can always check if File.Exist if you have doubts
According to Microsoft it manages the file name uniquely for u
http://msdn.microsoft.com/
What u can do to make sure there are no duplications is either test if there is a file already with that name in th folder using file.exists function, or on the return string from function GetTempFileName() - u can then save the file and adjust the file name and add at the end for examle the hour/minute/second/millise
hope this helps