Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,

good evening..plz help me..


A folder contains collection of files with the extension of .pdf and .xml.
How to get collection of .xml file name and populate the names in combobox?

can anyone suggest a code in vb.net?
Posted
Updated 27-Sep-12 0:09am
v2

1 solution

To get the list of file you can use DirectoryInfo. And iterate through the file names and add them to the combobox one by one.

VB
Dim di As New IO.DirectoryInfo("D:\MyFolder")
Dim directoryObject As IO.FileInfo() = di.GetFiles()
Dim fileInfoObject As IO.FileInfo

For Each fileInfoObject In directoryObject
    ListBox1.Items.Add(dra)
Next
 
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