SHOW MIME type of one file in GB3
If you want to know MIME type in GB3 of your files, you need to add gb.Desktop in your project property.
Well, when it's done, we will create new application who will open dialog box to choose one file and show name of choosen file and MIME type of this file.
This example bellow has this code :
Public Sub Button1_Click()
Dialog.Title = "selectionner un fichier" 'defini le titre de la boite
Dialog.Path = Application.Path 'defini le chemin par defaut ŕ l'ouverture
If Dialog.OpenFile() Then Return 'si on ne peut ouvrir le fichier alors ne rien faire
TextBox1.Text = Dialog.Path
TextBox2.Text = DesktopMime.FromFile(Dialog.Path).Type
End
Public Sub Form_Open()
Me.Center
End
In this form, put 2 textbox, and 2 buttons.
To return name's file, we use this dialog.path variable and to have MIME type of this file we use this command:
DesktopMime.FromFile(Dialog.Path).Type .
