C# Program to display temporary file names

CsharpProgrammingServer Side Programming

<p>The GetTempPath() method in C# displays temporary file names &minus;</p><pre class="result notranslate">Path.GetTempPath();</pre><p>Get the names in a variable and display &minus;</p><pre class="result notranslate">string tempFile = Path.GetTempPath();</pre><p>The following is the code &minus;</p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/imRhrv" rel="nofollow" target="_blank">&nbsp;Live Demo</a></p><pre class="prettyprint notranslate" style="">using System; using System.IO; class Demo { &nbsp; &nbsp;static void Main() { &nbsp; &nbsp; &nbsp; string tempFile = Path.GetTempPath(); &nbsp; &nbsp; &nbsp; Console.WriteLine(tempFile); &nbsp; &nbsp;} }</pre><h2>Output</h2><pre class="result notranslate">/tmp/</pre>
Updated on 22-Jun-2020 14:55:40