CHECK THE TYPE OF FILE CLICKED IN A LISTBOX

Mark Devid

Total Post:102

Points:714
Posted by  Mark Devid
C#
 1268  View(s)
Ratings:
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.

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: Check the type of file clicked in a listbox

    Hi Mark,


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

    FileInfo finfo = new Fileinfo(fileName);

    string fileName = finfo.Extension

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!