how to programatically check temporary files in system using c#

Total Post:135

Points:949
C#  .NET 
C#
 669  View(s)
Ratings:
Rate this:
Hi Everyone,
I want to access  all temporary files in my system with its size. Please give me a solution.

Thank You.
  1. Post:13

    Points:91
    Re: how to programatically check temporary files in system using c#

    To read from the temp file

    private static void ReadTmpFile(string tmpFile)
    {
        try
        {
            // Read from the temp file.
            StreamReader myReader = File.OpenText(tmpFile);
            Console.WriteLine("TEMP file contents: " + myReader.ReadToEnd());
            myReader.Close();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error reading TEMP file: " + ex.Message);
        }
    }

      Modified On Apr-11-2018 12:50:39 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!