I am trying to get the file size of large files (some are over 1 gig) using FileInfo. It works, but it takes 20 seconds or so. Really, all I need is to figure out if the file is over a certain size, for example 100mb. Is there a quicker way to do this?
New System.IO.FileInfo(ProcessPath).Length
Edit: BTW, the file I am using to test is a 1.6 gig executable installer. So I am guessing that each file in the installer is being read, and that is why it is taking so long. Is there any way to time out after 5 seconds or so, since if it takes longer than 5 seconds, we can safely assume that it is a large file?