I need to generate a unique temporary file with a .csv extension.
What I do right now is
string filename = System.IO.Path.GetTempFileName().Replace(
I think you should try this:
string path = Path.GetRandomFileName(); path = Path.Combine(@"c:\temp", path); path = Path.ChangeExtension(path, ".tmp"); File.Create(path);
It generates a unique filename and creates a file with that file name at a specified location.