zimmer9
asked on
How to check if a type txt file is empty using C# with Visual Studio 2005?
I am developing a C# console application using Visual Studio 2005.
I use the following statement in my program:
if (File.Exists(errorFilePath ))
Is there a way to open this txt type file and see if this file is empty?
I want to delete this file, if it is an empty file.
I use the following statement in my program:
if (File.Exists(errorFilePath
Is there a way to open this txt type file and see if this file is empty?
I want to delete this file, if it is an empty file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if (File.Length==0)
Console.Writeline("File is empty.");