I have downloaded the attachment and now I need to check the extension of file saved in folder weather it is pdf or excels or something else how can I solve this
Use this code to get all files inside a particular folder,
ArrayOfString = Directory.GetFiles(“FolderPath”).
Then use a for each and inside for each use if condition as “item.Contains(“pdf”)”
but how do i check weather it is pdf or excel ??
You can download these codes.It will return the file type and some of the details of the file and from that you can do your desire checking.
To get extension of file try the below code
no worries @arjun_27