|
Location: Desktop development - Visual Basic . NET License: The Intelliproject Open License (IPOL) Find the size of a file in VB.NETPosted by Manu AbrahamDescribe how to find the size of a file using VB.NET |
Skill: BeginnerPosted: 27/11/2008Views: 2305Rating: 0.00 /5Popularity: 0.00 |
| Sign Up to vote for this article |
In this article , I am going to describe the steps to find the size of a file using VB.NET.
We need to find the size of a file. We can get the information about the file using the 'FileInfo' class in VB.NET. The 'FileInfo' class belongs to the 'System.IO' Namespace.
So we need to import the particular namespace using the following line in our script
Imports System.IO
We can make use of the 'FileInfo' to get the size of the file.
Dim MyFile As New FileInfo(MyFilePath)
Dim FileSize As Long = MyFile.Length
Return FileSize
Where MyFile is the object of the class 'FileInfo' . The 'Length' property of the 'FileInfo' class will give the size of the file.
In the following code , we just need to input the full path to the file, whose size is to find out.
Please forward your queries and suggestions to:
manu@phppals.net
manu@manuabraham.info
http://manuabraham.info
This article, along with any associated source code and files, is licensed under The Intelliproject Open License (IPOL)
| Manu Abraham
| Manu Abraham having an experience of more than 3 years in PHP-MySQL web development. Location: |
Sign up to post message on the article message board!