C# Path GetTempPath

Description

Path GetTempPath Returns the path of the current user's temporary folder.

Syntax

Path.GetTempPath has the following syntax.


public static string GetTempPath()

Returns

Path.GetTempPath method returns The path to the temporary folder, ending with a backslash.

Example

The following code shows how to call the GetTempPath method.


/*w ww .  j a  v a  2s  . co m*/
using System;
using System.IO;
public class MainClass
{
    public static void Main(String[] argv)
    {
        string result = Path.GetTempPath();
        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