Hey Frnds to calculate the File Size everytime we have to give extension such as .txt,.doc.
AS FOLL--
I want that Only I change the File name & it computes the Size everytime giving the extension...... .
Plz do reply back,I will be very thxful to u.
AS FOLL--
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim filelength As Long
filelength = GetFileSize("D:\Documents and Settings\Administrator\Desktop\Private Function SaveDetails[1].doc")
MsgBox(filelength)
End Sub
Private Function GetFileSize(ByVal MyFilePath As String) As Long
Dim MyFile As New FileInfo(MyFilePath)
Dim FileSize As Long = MyFile.Length / 1024
Return FileSize
End Function
Plz do reply back,I will be very thxful to u.
Comment