Home > DeveloperSection > Forums > Check the type of file clicked in a listbox
Mark Devid
Mark Devid

Total Post:101

Points:707
Posted on    September-04-2013 3:13 AM

 C#
Ratings:


 1 Reply(s)
 963  View(s)
Rate this:

How can I check the file type of an object in my listbox

I'm returning a list of strings from an online server and simply wanting to have an event that gets fired when I click on an item that has a .folder file type at the end

I've tried looking but can't find anything.

Can someone please provide a link or sample code so I can achieve what I would like to achieve.



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    September-04-2013 7:09 AM

Hi Mark,

You could include the FileInfo assembly and use FileInfo.Extension.

FileInfo finfo = new Fileinfo(fileName);

string fileName = finfo.Extension


Don't want to miss updates? Please click the below button!

Follow MindStick