C# Path GetTempFileName

Description

Path GetTempFileName Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.

Syntax

Path.GetTempFileName has the following syntax.


public static string GetTempFileName()

Returns

Path.GetTempFileName method returns The full path of the temporary file.

Example


using System;//w  ww  .j  a  va 2 s. c  om
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        string result = Path.GetTempFileName();
        Console.WriteLine(result);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter