Hi, I am looking to check the size of a text file using c#, the text file will be in a folder, I need to make sure it contains data before I email it.
I have the email side working ok just need to get the file size / length?
Any help much appreciated
Loading
Bryian TanPosted Aug 24, 2010, 12:38 AM
Here is an example.
System.IO.FileInfo fs = new System.IO.FileInfo(Server.MapPath("~/app_data/") + "YourTextFileName.txt");
int fileLength = Convert.ToInt32(fs.Length);