Soyez le premier à donner votre avis sur cette source.
Vue 4 730 fois - Téléchargée 397 fois
'Il faut un boutton=command1 '============ 'La Fonction==== '============ Public Function SupprSection(Section As String, FichierINI As String) Dim a As Long Dim i As Long Dim Lettre As String Dim Ligne As String Dim Found As String Dim INI As String Dim Detect As Boolean Dim LongeurChaine As Long Detect = True i = 0 a = FreeFile() Open FichierINI For Input As #a While Not EOF(a) Line Input #a, Ligne Lettre = Left(Ligne, 1) If Lettre = "[" Then i = i + 1 Found = InStr(Ligne, "[" & Section & "]") If Found = 0 Then INI = INI & vbCrLf & Ligne: Detect = True Else Detect = False ElseIf Lettre <> "" And Lettre <> "[" Then If Detect = True Then Found = InStr(Ligne, "=") If Found <> 0 Then INI = INI & vbCrLf & Ligne End If End If Wend Close #a LongeurChaine = Len(INI) Open FichierINI For Output As a If LongeurChaine = 0 Then Print #a, INI Else Print #a, Right(INI, LongeurChaine - 2) End If Close a End Function '========== 'L'appel===== '========== Private Sub Command1_Click() SupprSection "Setting", App.Path & "\Fichierini.ini" End Sub
18 juin 2005 à 11:59
Merci a toi
9 mars 2004 à 16:14
http://www.vbfrance.com/code.aspx?ID=7885
23 mai 2003 à 00:10
WritePrivateProfileString(SectionAEffacer, NULL, NULL, FichierINI);
bon aller je te met 10 car tu m'as évité de l'écrire.
bonne prog
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.