Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3423 connectés 

 


Dernière réponse
Sujet : Fichier INI
Carbon_14 Comme quoi Bendes y a pensé, Borland l'a fait !!  :D
 
En fouillant dans la doc, j'ai trouvé qu'on pouvait aussi EFFACER en passant un paramètre NULL ! Ze savait pas.. CQFD.
 
The WriteProfileString function copies a string into the specified section of the WIN.INI file.  
 
This function is provided for compatibility with 16-bit Windows-based applications. Win32-based applications should store initialization information in the registry.  
 
BOOL WriteProfileString(
 
    LPCTSTR lpAppName, // pointer to section name  
    LPCTSTR lpKeyName, // pointer to key name  
    LPCTSTR lpString  // pointer to string to write  
   );  
 
 
Parameters
 
lpAppName
 
Points to a null-terminated string that specifies the section to which the string is to be copied. If the section does not exist, it is created. The name of the section is not case-sensitive; the string can be any combination of uppercase and lowercase letters.  
 
lpKeyName
 
Points to a null-terminated string containing the key to be associated with the string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries in the section, is deleted.  <<<===  :D
 
lpString
 
Points to a null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted.  <<====
Windows 95: This platform does not support the use of the TAB (\t) character as part of this parameter.

Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
Carbon_14 Comme quoi Bendes y a pensé, Borland l'a fait !!  :D
 
En fouillant dans la doc, j'ai trouvé qu'on pouvait aussi EFFACER en passant un paramètre NULL ! Ze savait pas.. CQFD.
 
The WriteProfileString function copies a string into the specified section of the WIN.INI file.  
 
This function is provided for compatibility with 16-bit Windows-based applications. Win32-based applications should store initialization information in the registry.  
 
BOOL WriteProfileString(
 
    LPCTSTR lpAppName, // pointer to section name  
    LPCTSTR lpKeyName, // pointer to key name  
    LPCTSTR lpString  // pointer to string to write  
   );  
 
 
Parameters
 
lpAppName
 
Points to a null-terminated string that specifies the section to which the string is to be copied. If the section does not exist, it is created. The name of the section is not case-sensitive; the string can be any combination of uppercase and lowercase letters.  
 
lpKeyName
 
Points to a null-terminated string containing the key to be associated with the string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries in the section, is deleted.  <<<===  :D
 
lpString
 
Points to a null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted.  <<====
Windows 95: This platform does not support the use of the TAB (\t) character as part of this parameter.
antp avec Delphi et C++Builder y a la méthode EraseSection du composant TIniFile.
El_gringo J'crois pas que ça existe. Donc; à ton clavier ! y a du boulot un rien emmerdant à faire !:D
Bendes C'est clair, j'avais pensé à toutes ces solutions "rustines" mais j'me disais que si un truc existais déjà, ça aurait été chouette de l'employé...
Carbon_14 Je ne pense pas. Les API liées aux fichiers INI permettent de mettre à jour, de modifier, pas de supprimer.
 
Le seul truc faisable (hors lecture ASCII du fichier et gestion "manuelle"(soft) de recopie sans la section à supprimer) est de mettre à blanc les sections.
[sect1]
toto=
bidul=
chose=
 
Si on ajoute de nouvelles rubriques, celles qui ne servent plus restent !!
 
Un autre moyen : lire le fichier INI, le "deleter" puis le réécrire avec les nouvelles rubriques.
 
 :)
Bendes Existe-t-il un moyen de supprimer un section entière dans un fichier de type INI (via les API's ou autres...) ????

Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)