Programmation, programme ouvre régulièrement

Résolu
guibbor Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   -  
guibbor Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
Je cherche a créer un programme sur mon ordinateur qui ouvre automatiquement un dossier, une image, un fichier ou un programme toutes les x secondes, quel langage utiliser svp ? Connaissez vous un bon tuto pour ce langage ? Et si vous avez un script tout fait, je suis preneur !

Merci !



3 réponses

guibbor Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   19
 
Up !
0
KX Messages postés 16761 Date d'inscription   Statut Modérateur Dernière intervention   3 020
 
Je pense que la plupart des langages doivent pouvoir faire ça.

Exemple en Java :

public class Test
{
    public static void main(String[] args) throws Exception
    {
        // the Desktop instance of the current browser context
        java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
        
        // the file to be opened with the associated application
        java.io.File file = new java.io.File("C:/");
        
        // the length of time to sleep in milliseconds
        long millis = 5000;
        
        while (true)
        {
            // Launches the associated application to open the file.
            // If the specified file is a directory, the file manager of the current platform is launched to open it.
            desktop.open(file);

            // Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds, subject to the precision and accuracy of system timers and schedulers.
            Thread.sleep(millis); 
        }
    }
}
0
guibbor Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   19
 
Merci Bien :)
0