get images from a directory vb.net
How to get all the images from a directory and a sub directory in vb.net Can I have the code for it in vb.net?

Software/Hardware used:
ASKED: May 24, 2008  7:19 PM
UPDATED: May 27, 2008  1:45 PM

Answer Wiki:
<pre> Imports System.IO Dim strFileSize As String = "" Dim di As New IO.DirectoryInfo("C:temp") Dim aryFi As IO.FileInfo() = di.GetFiles("*.*") Dim fi As IO.FileInfo For Each fi In aryFi if fi.Extension = ".jpg" or fi.Extension = ".gif" or fi.Extension = ".bmp" ''etc etc etc strFileSize = (Math.Round(fi.Length / 1024)).ToString() Console.WriteLine("File Name: {0}", fi.Name) Console.WriteLine("File Full Name: {0}", fi.FullName) Console.WriteLine("File Size (KB): {0}", strFileSize ) Console.WriteLine("File Extension: {0}", fi.Extension) Console.WriteLine("Last Accessed: {0}", fi.LastAccessTime) Console.WriteLine("Read Only: {0}", (fi.Attributes.ReadOnly = True).ToString) End if Next</pre> Adjust your code in order to match the given file extensions. Bye
Last Wiki Answer Submitted:  May 26, 2008  9:10 am  by  alessandro.panzetta   9,695 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _