Home > DeveloperSection > Forums > how to programatically check temporary files in system using c#
Anupam Mishra

Total Post:135

Points:949
Posted on    January-21-2016 6:48 AM

 C# C#  .NET 
Ratings:


 1 Reply(s)
 199  View(s)
Rate this:
Hi Everyone,
I want to access  all temporary files in my system with its size. Please give me a solution.

Thank You.


Shiva Shukla
Shiva Shukla

Total Post:13

Points:91
Posted on    January-24-2016 11:21 PM

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

Don't want to miss updates? Please click the below button!

Follow MindStick