samedi 19 août 2017

Is there a shortened method to loop through conditions in IF in VB.NET

So I am making a program that needs to check if a file is of Video / Audio format. To do this I have this code (Song is a SYSTEM.IO.FILEINFO):

If Song.Extension.ToUpper = ".MP4" Or Song.Extension = ".AVI" Or Song.Extension = ".MP3" Or Song.Extension = ".AA" Or Song.Extension = ".M4A" Or Song.Extension = ".AIFF" Or Song.Extension = ".WAV" Or Song.Extension = ".M4V" Or Song.Extension = ".AAC" Or Song.Extension = ".VOB" Then

The problem is that this only checks the first 2 conditions. Do I need to split this into separate IFs or is there some way to test all the conditions in one line?

Thanks, Phantom

Aucun commentaire:

Enregistrer un commentaire