
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
C# Program to display temporary file names
The GetTempPath() method in C# displays temporary file names −
Path.GetTempPath();
Get the names in a variable and display −
string tempFile = Path.GetTempPath();
The following is the code −
Example
using System; using System.IO; class Demo { static void Main() { string tempFile = Path.GetTempPath(); Console.WriteLine(tempFile); } }
Output
/tmp/
- Related Articles
- Golang program to create a temporary file
- Program to make file names unique using Python
- How to delete a temporary file in Java?
- How to create a temporary file using PowerShell?
- Create a temporary file in Java
- Creating a Temporary File in Linux
- How to generate secure temporary file name using Python?
- How to create a unique temporary file name using Python?
- Create temporary file in specified directory in Java
- Display weekday names in Java
- Create temporary file with specified extension suffix in Java
- Write a C program to read a data from file and display
- How to display errors in PHP file?
- How to filter the files by file extensions and show the file names in Java?
- Java Program to list Weekday names

Advertisements