Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to check Image size at the time of selecting image using open dialog box control.I refer many codes but they are not working

What I have tried:

If  Dim info as New FileInfo(.FileName).Length < 50 Then



the error message is
Expression Expected.
Posted
Updated 17-Sep-18 2:16am
Comments
phil.o 17-Sep-18 8:58am    
I am confused as whether you want to get the file size (the total number of bytes which image data holds), or the size of the image (i.e., its width and height in pixels). Please clarify that point.

1 solution

Try to split above statement into:
VB
Dim fi As FileInfo = New FileInfo(.FileName)
If fi.Length < 50 Then
   '...
End If


For further details, please see: FileInfo Class (System.IO) | Microsoft Docs[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900