Setting the filter to an OpenFileDialog to allow the typical image formats?

前端 未结 11 954
陌清茗
陌清茗 2020-12-22 16:07

I have this code, how can I allow it to accept all typical image formats? PNG, JPEG, JPG, GIF?

Here\'s what I have so far:

public void EncryptFile()
         


        
11条回答
  •  生来不讨喜
    2020-12-22 16:23

    From the docs, the filter syntax that you need is as follows:

    Office Files|*.doc;*.xls;*.ppt
    

    i.e. separate the multiple extensions with a semicolon -- thus, Image Files|*.jpg;*.jpeg;*.png;....

提交回复
热议问题