HOW TO PROGRAMATICALLY CHECK TEMPORARY FILES IN SYSTEM USING C#

Anupam Mishra

Total Post:135

Points:949
Posted by  Anupam Mishra
C#  .NET 
C#
 413  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. Shiva Shukla

    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);
        }
    }

Answer

NEWSLETTER

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