listbox to use Product Name........
i'm filling a listbox to fill with *.exe files that are in a specified directory. these show up just fine. their Name is cr100.exe and cr200.exe. what i need help in figuring out is how to set the .Displaymember property to display the individual .exe files' Product Name.
i've created the .exe's they are reports. so i've given the attributes of the files Product name to have something in English. like Inventory Listing, and Balance Sheet. This is what i want to display in the listbox.
thanks, i'd appreciate some guidance here.
not fullname, need Product Name
thanks for the reply, but i have no problem getting or displaying the Fullname of the EXE's in the listbox.
here is my code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
sReportPath = GetProgPath()
Dim di As New DirectoryInfo(sReportPath)
With lstAvailReports
.DataSource = di.GetFiles("*.exe")
.DisplayMember = FileVersionInfo.GetVersionInfo(.DataSource)
End With
my line with the .DisplayMember = is wrong, but it's what i'm trying to get at.
the fullname is loaded in the datasource, as c:\program files\dc shell\cr100.exe and is index 0, the next file is index 1, etc.
if you look at the properties of an EXE file, one of the attributes is the Product Name. which is what i want to display in the listbox. ie. cr100.exe = Inventory Listing, but it needs to set for each file in the array for .datasource.