Vb6+enregistrement des fichiers

spootnic22 Messages postés 84 Date d'inscription mardi 31 octobre 2006 Statut Membre Dernière intervention 30 janvier 2010 - 13 nov. 2006 à 09:47
spootnic22 Messages postés 84 Date d'inscription mardi 31 octobre 2006 Statut Membre Dernière intervention 30 janvier 2010 - 13 nov. 2006 à 16:10
Salut,
Pourriez vous me dire comment la sauvegarde des fichiers html dans un repertoire sans passé par le biais da boites de dialogue CommonDialog.ShowSave?
Merci Bcp.

<!-- / message -->

3 réponses

lilo44 Messages postés 174 Date d'inscription vendredi 25 janvier 2002 Statut Membre Dernière intervention 15 février 2007 2
13 nov. 2006 à 10:01
Bonjour

ca manque de précision la .... elle sera ou la page HTML a la base par exemple ?
0
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
13 nov. 2006 à 12:09
merci de d'abord donner suite à ton premier topic
http://www.vbfrance.com/infomsg_ENREGISTRER-CODE-HTML-PAGE-WEB_839910.aspx#3

pour peu qu'ils soient liés.....
<hr size="2" width="100%" />Prenez un instant pour répondre à ce sondage svp
0
spootnic22 Messages postés 84 Date d'inscription mardi 31 octobre 2006 Statut Membre Dernière intervention 30 janvier 2010
13 nov. 2006 à 16:10
Salut,
voici le code que j'ai fait pour ce problème:
-------------------------------------------------------
Private Sub Command2_Click()
    Dim src, nomfich, NumFich, sPath, MyPath As String
    Dim x, i, p, j As Integer
    Dim sDate, sr As String
    Dim trouver As Boolean
   
    src = WebBrowser1.Document.documentElement.outerHTML
    For x = 0 To WebBrowser1.Document.links.length - 1
        List1.AddItem (WebBrowser1.Document.links(x))
    Next
    i = FreeFile
    sDate = Format(Date, "yyyymmdd")
    sPath = "D:\Production\EBP\Source" & sDate
    j = 1        If (MyPath Dir(sPath, vbDirectory)) vbEmpty Then
                CommonDialog1.InitDir = sPath
                CommonDialog1.FileName = "Annonce" & j & ".html "
                nomfich = Me.CommonDialog1.FileName
           If Dir(nomfich, vbNormal Or vbReadOnly Or vbHidden Or vbArchive) = "" Then
                CommonDialog1.FileName = "Annonce" & j & ".html "
                nomfich = Me.CommonDialog1.FileName
                Open nomfich For Output As #i
                Print #i, src
                Close #i
           Else
                j = j + 1
                CommonDialog1.FileName = "Annonce" & j & ".html "
                nomfich = Me.CommonDialog1.FileName
                Open nomfich For Output As #i
                Print #i, src
                Close #i
           End If
        Else
            MkDir "D:\Production\EBP\Source" & sDate
            CommonDialog1.InitDir = sPath
            CommonDialog1.FileName = "Annonce" & j & ".html "
            nomfich = Me.CommonDialog1.FileName          If MyPath Dir(nomfich, vbNormal Or vbReadOnly Or vbHidden Or vbArchive) "" Then
            CommonDialog1.FileName = "Annonce" & j & ".html "
            nomfich = Me.CommonDialog1.FileName
            Open nomfich For Output As #i
            Print #i, , src
            Close #i
          Else
            j = j + 1
            CommonDialog1.FileName = "Annonce" & p & ".html "
            nomfich = Me.CommonDialog1.FileName
            Open nomfich For Output As #i
            Print #i, , src
            Close #i
          End If
        End If
      
End Sub
----------------------------------------------------------
à l'execution, l'application sauvegarde seulement 2 fichiers "Annonce1.html" et "Annonce2.html" mais moi je veux qu'à chaque sauvegarde le fichier Annonce.html sera sauvegarder en incrémantant le conteur dans la même session.
Merci Bcp.
0
Rejoignez-nous