Newsgroup: it.comp.lang.visual-basic
Titolo: [Files di testo]

salve a tutti
come posso memorizzare un files che contenga delle stringhe di testo una
sotto l'altra del tipo
<html>
<head>
<title>
...
...
...
qui deve andare qualcosa digitato in varie textbox :)
<html>
grazie in anticipo
Merlino666

 <html>
p.e. come segue -- se vuoi vedere il risultato, freelinx e vblinx sul mio
sito,
hth, pal
--
andrea palazzi
xday at libero dot it
free sw - 
http://www.comune.modena.it/cittadini/apal/html/
Private Sub MyHTML()
    On Error GoTo errman
    If cboSearch = "" Then Exit Sub
    If MsgBox("Stampare su HTML l'area " & UCase(cboSearch) & " ?",
vbYesNoCancel) _
        <> vbYes Then Exit Sub
    DbClean
    Dim time1, time2, tmpNote, tmpD
    Dim outNum, outName, oldCaption
    Dim db As Database, rs As Recordset
    Dim tmpS1, tmpS2, tmpS3, tmpITA, tmpGOOD
    Dim cntSK As Integer, cntXEN As Integer, cntNF As Integer
    Dim cnt2K As Integer, cntOK As Integer, cntNO As Integer
    cntSK = 0: cntXEN = 0: cntNF = 0: cntNO = 0: cnt2K = 0: cntOK = 0
    time1 = Timer
    tmpGOOD = "<img src=" & Chr(34) & "../img/yl-a.gif" & Chr(34) & ">" &
"&nbsp;"
    tmpITA = _
        "<img src=" & Chr(34) & "../img/gr-a.gif" & Chr(34) & ">" _
        & "<img src=" & Chr(34) & "../img/wh-a.gif" & Chr(34) & ">" _
        & "<img src=" & Chr(34) & "../img/re-a.gif" & Chr(34) & ">" _
        & "&nbsp;"
    Set db = OpenDatabase(MyPath & "internet.mdb")
    Set rs = db.OpenRecordset("indirizzi")
    rs.Index = "area_descrizione"
    oldCaption = Caption
    outNum = FreeFile
    outName = LCase(StrTran(cboSearch, ".", "_"))
    outName = MyPath & outName & ".html"
    Open outName For Output As outNum
    Print #outNum, "<html>"
    Print #outNum, "<title>" & cboSearch & " -- " & Now & "</title>"
    Print #outNum, "<body bgcolor=#505050 text=#ffffff link=#ffff3c
vlink=#ffb900 alink=#ff6060>"
    Print #outNum, "<font size=2; face=verdana>"
    Print #outNum, "<hr>"
    Print #outNum, "<font color=#00ffff>" & cboSearch & "</font> :: " & Now
    Print #outNum, "<hr>"
    Print #outNum, "<font size=2; face=verdana>"
'-----------EMAIL
    Print #outNum, "<a href=" & Chr(34) & _
        "mailto:
ap...@zelig.it
?subject=" & LCase(cboSearch) & " sites" &
Chr(34) & _
        ">Update a site / Send a site not yet here ::: Aggiorna / Segnala un
sito</a>"
'-----------FINE FORM / EMAIL
    Print #outNum, "<hr>"
    Print #outNum, "</font>"
    Print #outNum,
    With rs
        .Seek ">=", cboSearch
        'Do While Not .EOF
        Do While !area = cboSearch
            If .EOF Then Exit Do
            If (Not !dontput And Not !notfound) Or _
            (Not !dontput And (!xenu And !notfound)) Then
                cntSK = cntSK + 1
                Caption = "Scheda # " & cntSK
                tmpS1 = "": tmpS2 = "": tmpS3 = ""
                tmpS3 = tmpS3 & IIf(!buono, ":)", "")
                tmpS3 = tmpS3 & IIf(!bigsite, " : BIG", "")
                tmpS3 = tmpS3 & IIf(!free, " : FREE", "")
                tmpS3 = tmpS3 & IIf(!share, " : PAY", "")
                tmpS3 = tmpS3 & IIf(!tutorial, " : HLP", "")
                tmpS3 = tmpS3 & IIf(!codice, " : COD", "")
                tmpS3 = tmpS3 & IIf(!controlli, " : OCX", "")
                tmpS3 = tmpS3 & IIf(!api, " : API", "")
                tmpS3 = tmpS3 & IIf(!actx, " : ACTX", "")
                tmpS3 = tmpS3 & IIf(!dirx, " : DIRX", "")
                tmpS3 = tmpS3 & IIf(!vbscript, " : VBS", "")
                tmpS3 = tmpS3 & IIf(!VBA, " : VBA", "")
                tmpS3 = tmpS3 & IIf(!links, " : LNX", "")
                tmpS3 = tmpS3 & IIf(!db, " : DB", "")
                tmpS3 = tmpS3 & IIf(!grafica, " : GRFX", "")
                tmpS3 = tmpS3 & IIf(!mmedia, " : MMED", "")
                tmpS3 = tmpS3 & IIf(!games, " : GAME", "")
                tmpS3 = tmpS3 & IIf(!compress, " : ZIP", "")
                tmpS3 = tmpS3 & IIf(!nt, " : NT", "")
                tmpS3 = tmpS3 & IIf(!network, " : NETW", "")
                tmpS3 = tmpS3 & IIf(!internet, " : I/NET", "")
                tmpS3 = tmpS3 & IIf(!html, " : HTML", "")
                tmpS3 = tmpS3 & IIf(!java, " : JAVA", "")
                tmpS3 = tmpS3 & IIf(!webservices, " : WSERV", "")
                tmpS3 = tmpS3 & IIf(!mag, " : NWS", "")
                tmpS3 = tmpS3 & IIf(!school, " : SCHL", "")
                tmpS3 = tmpS3 & IIf(!cv, " : JOBS", "")
                tmpS3 = Trim(tmpS3)
                If !buono Then
                    If LCase(!nazione) = "italia" Then
                        tmpS1 = "<p>" & tmpGOOD & tmpITA & "<a href=" &
Chr(34) & _
                            Trim(!prot) & Trim(!url) & Chr(34) & "
target=_blank>" & _
                            Trim(!descri) & "</a>"
                    Else
                        tmpS1 = "<p>" & tmpGOOD & "<a href=" & Chr(34) & _
                            Trim(!prot) & Trim(!url) & Chr(34) & "
target=_blank>" & _
                            Trim(!descri) & "</a>"
                    End If
                Else
                    If LCase(!nazione) = "italia" Then
                        tmpS1 = "<p>" & tmpITA & "<a href=" & Chr(34) & _
                            Trim(!prot) & Trim(!url) & Chr(34) & "
target=_blank>" & _
                            Trim(!descri) & "</a>"
                    Else
                        tmpS1 = "<p>* <a href=" & Chr(34) & _
                            Trim(!prot) & Trim(!url) & Chr(34) & "
target=_blank>" & _
                            Trim(!descri) & "</a>"
                    End If
                End If
                tmpD = StrTran(Format(!datains, "short date"), "/", ".")
                'If !xenu Then
                If !notfound And !xenu Then
                    cntXEN = cntXEN + 1
                    tmpS2 = "<font color=#00ffff size=1>[" & tmpD & " :
NO -- xenu : Y]</font>"
                ElseIf Not !controllo Then
                    cnt2K = cnt2K + 1
                    tmpS2 = "<font color=#00ffff size=1>[" & tmpD &
"]</font>"
                Else
                    cntOK = cntOK + 1
                    tmpS2 = "<font size=1>[" & tmpD & " - OK]</font>"
                End If
                Print #outNum, tmpS1
                Print #outNum, tmpS2
                If tmpS3 <> "" Then Print #outNum, "<br><font color=#00ff00
size=1>" & tmpS3 & "</font>"
                If !note <> "" Then Print #outNum, "<br><font color=#d4d4d4
size=2>" & Trim(!note) & "</font>"
                Print #outNum, "</p>"
                Print #outNum,
            ElseIf !notfound And Not !xenu Then
                cntNF = cntNF + 1
            Else
                cntNO = cntNO + 1
            End If 'if not !dontput
            DoEvents
            .MoveNext
            If .EOF Then Exit Do
        Loop
    End With
    time2 = Timer
    Print #outNum, "<hr>"
    Print #outNum, "<font size=2>"
    'Print #outNum, "total links: " & cntSK + cntNF + cntNO
    Print #outNum, "total links: " & _
        cntOK + cnt2K + cntXEN + cntNF + cntNO
    Print #outNum, "<br>- listed: " & (cntOK + cnt2K + cntXEN) & _
        " (" & cntOK & " found -- " & cntXEN & " lost+found -- " & cnt2K & "
uncheked)"
    Print #outNum, "<br>- not listed: " & (cntNF + cntNO) & _
        " (" & cntNF & " lost -- " & cntNO & " redir / useless)"
    Print #outNum, "<br>Page printed in " & _
        Format(Timer - time1, "###,###,##0.###") & _
        " secs by <font color=#00ffff>NetAdrs</font> © <a href=" & _
        Chr(34) & "
http://www.comune.modena.it/cittadini/apal/html
" & _
        Chr(34) & " target=_blank>SundaySw</a>"
    Print #outNum, "</font>"
    Print #outNum, "<hr>"
    Print #outNum, "</body>"
    Print #outNum, "</html>"
    Close #outNum
    rs.Close
    db.Close
    Caption = oldCaption
    Dim iRet As Long
    iRet = ShellExecute(Me.hwnd, vbNullString, _
        outName, vbNullString, MyPath, SW_SHOWNORMAL)
    Exit Sub
errman:    MsgBox Error: Exit Sub
End Sub