Hi,
In Form1 i have a Textbox1, in this textbox i have the loaction of a file "C:\folder\file.iso"
In the Form2 i want to get the file size of the file in Textbox1 so i tried this
Dim fileDetail As IO.FileInfo
fileDetail = My.Computer.FileSystem.GetFileInfo(Form1.Textbox1.Text)
Label1.Text = Size: fileDetail.Length
End Sub
I dont get an error, but the size of the file isn't showed in the label.
Edit: This doesnt seem to work
Private Sub Unscramble_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If System.IO.File.Exists(Form1.TextBox2.Text) Then
Dim fi As New System.IO.FileInfo(Form1.TextBox2.Text)
Label3.Text = "Size: " & fi.Length.ToString()
End If
End Sub
It still doesnt give me the size of the file nor it gives the "Size:"