Modification propriétés fichier txt

Spawn3107 Messages postés 84 Date d'inscription mardi 14 décembre 2004 Statut Membre Dernière intervention 28 mars 2011 - 24 nov. 2010 à 10:11
Spawn3107 Messages postés 84 Date d'inscription mardi 14 décembre 2004 Statut Membre Dernière intervention 28 mars 2011 - 24 nov. 2010 à 15:03
Bonjour tout le monde,

j'ai un petit problème dans mon application. Je souhaite modifié une propriété d'un fichier .txt. Donc lorsqu'on fait clique droit sur le fichier txt => propriétés, on peut modifier certains champs : Titre, Objet, Auteur,...

Est-ce que quelqu'un a déja eu le même problème ou est-ce quelqu'un peut m'aider ?


Merci.

1 réponse

Spawn3107 Messages postés 84 Date d'inscription mardi 14 décembre 2004 Statut Membre Dernière intervention 28 mars 2011
24 nov. 2010 à 15:03
J'ai trouvé comment lire les propriétés, mais malheureusement pas encore comment écrire dans les propriétés:

public static void ReadProperties()
        {
            List<string> arrHeaders = new List<string>(); 
 
            Shell32.Shell shell = new Shell32.Shell(); 
            Shell32.Folder objFolder;

            objFolder = shell.NameSpace(@"C:\Documents and Settings\cpo\Bureau\Projets\TechSpace"); 
     
            for( int i = 0; i < short.MaxValue; i++ ) 
            { 
                string header = objFolder.GetDetailsOf(null, i); 
                if (String.IsNullOrEmpty(header)) 
                    break; 
                arrHeaders.Add(header); 
            } 
     
            foreach(Shell32.FolderItem2 item in objFolder.Items()) 
            { 
                for (int i = 0; i < arrHeaders.Count; i++) 
                { 
                    Console.WriteLine("{0}\t{1}: {2}", i, arrHeaders[i], objFolder.GetDetailsOf(item, i));                     
                } 
            } 

        }
0
Rejoignez-nous