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)
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jaish MathewsRank #225 · 11K reputationPosted Mar 26, 2010, 10:09 PM EDT
using (FileStream str = new FileStream(Server.MapPath("Notes.txt"), FileMode.Open))
{
long size = str.Length;
}
abhay pundir4 reputationPosted Mar 26, 2010, 11:09 PM EDT
FileInfo fi = new FileInfo("filename");
MessageBox.Show(((fi.Length)/1024).ToString());