Page loading

Share your opinion
What do you think about gambaslinux.fr?
 
Interesting
It miss some informations
Excellent website
Results
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
_gb3.pngUse File - MIME type

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 .
smile


Creation date : 06/04/2017 @ 00:42
Last update : 06/04/2017 @ 00:44
Category : Use File
Page read 3038 times


Print the article Print the article


react.gifReactions to this article

Nobody gave a comment yet.
Be the first one to do it!


QUICK MENU
SEARCH




LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS

   visitors

   visitors online

ARCHIVES GAMBAS 1/2
^ Top ^