N
Niels
Hello, i want to read out the file names of a directory.
The previous time, i got this piece of code from someone,
but this code counts the number of files in a directory.
My intentions are to get the filenames (without extension)
in a combobox....
~~~~~~~~~~
Code
~~~~~~~~~~
Imports System
Imports System.IO
Dim di As DirectoryInfo = New DirectoryInfo("c:\")
Try
Dim dirs As FileSystemInfo() = di.GetDirectories("*p*")
Console.WriteLine("Number of directories with a p: _
{0}", dirs.Length)
Dim diNext As DirectoryInfo
For Each diNext In dirs
Console.WriteLine("The number of files and _
directories " + "in {0} with an e is {1}", diNext, _
diNext.GetFileSystemInfos("*e*").Length)
Next
Catch e As Exception
Console.WriteLine("The process failed: {0}", _
e.ToString())
End Try
~~~~~~~~~~
Code
~~~~~~~~~~
Can anyone help me???
The previous time, i got this piece of code from someone,
but this code counts the number of files in a directory.
My intentions are to get the filenames (without extension)
in a combobox....
~~~~~~~~~~
Code
~~~~~~~~~~
Imports System
Imports System.IO
Dim di As DirectoryInfo = New DirectoryInfo("c:\")
Try
Dim dirs As FileSystemInfo() = di.GetDirectories("*p*")
Console.WriteLine("Number of directories with a p: _
{0}", dirs.Length)
Dim diNext As DirectoryInfo
For Each diNext In dirs
Console.WriteLine("The number of files and _
directories " + "in {0} with an e is {1}", diNext, _
diNext.GetFileSystemInfos("*e*").Length)
Next
Catch e As Exception
Console.WriteLine("The process failed: {0}", _
e.ToString())
End Try
~~~~~~~~~~
Code
~~~~~~~~~~
Can anyone help me???