How to know the File Type

studio

#1

Hello,

I have multiple files in my Directory. And I am verifying one by one, where if the file is zip file then I want to extract it. So I want to know the file type. How to do it?

Regards,
Hemal


#2

https://msdn.microsoft.com/en-us/library/system.io.path.getextension(v=vs.110).aspx

like above thread compare with your .zip.
or

you can get only all zip files from directotr and traverse it as per your needs.

Directory.GetFiles(folder_path,".zip",SearchOption.AllDirectories)

Regards…!!
Aksh


#3

Regarding the extract part…fyi


#4

Thank you so much. I have done it :slight_smile: