June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to get a file name that you can use for a temporary file.
Use the shared Path.GetTempFileName method.
There are a number of approaches to generating temporary files. In simple cases, you might just create a file in the application directory, possibly using a GUID filename or a timestamp in conjunction with a random value. However, the System.IO.Path class provides a helper method that can save you some work. It returns a unique filename (in the current user’s temporary directory) that you can use to create a file for storing temporary information. This might be a path like c:\documents and settings\username\local settings\temp\tmpac9.tmp.
Dim TempFile As String = Path.GetTempFileName() Console.WriteLine("Using ...Read now
Unlock full access