How to get size of any file in vb.net
I want to know is their any vb.net code that shows size of files( like .mdb, .xls etc)
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
abhay pundirPosted Mar 27, 2010, 3:09 AM
FileInfo fi = new FileInfo("filename");
MessageBox.Show(((fi.Length)/1024).ToString());
Jaish MathewsPosted Mar 27, 2010, 2:09 AM
using (FileStream str = new FileStream(Server.MapPath("Notes.txt"), FileMode.Open))
{
long size = str.Length;
}