Äã ÏÖ ÔÚ ·Ã ÎÊ µÄ Õ¾ µã µÄ Ò³ Ãæ Êµ ¼Ê ÉÏ ¾Í ÊÇ ²É ÓÃ Ä£ °å ·½ Ê½ Éú ³É µÄ ¡£ Äã ¿É ÒÔ Õâ Ñù ×é Ö¯ Äã µÄ Ä£ °å ÎÄ ¼þ £º 
    <HTML> 
    ... 
    <B><!-- Name --></B> 
    ... 
    </HTML> 
    È» ºó Ê¹ ÓÃ Replaceº¯ Êý ½« ¡° <!-- Name -->¡± Ìæ »» Îª Æä Ëû µÄ Öµ £º 
    Open "template.htm" For Input As #1 
    Open "result.htm" For Output As #2 
    Do While Not Eof(1) 
     Line Input #1, s 
     s = Replace(s, , "<!-- Name -->", rd("Name")) 
     Print #2, s 
    Loop 
    Close 1 
    Close 2 
    ReplaceÊÇ VB 6µÄ ÐÂ º¯ Êý £¬ Èç ¹û Äã Ê¹ ÓÃ µÄ ÊÇ vb6£¬ ¿É ÒÔ ¼Ó Èë ÏÂ Ãæ µÄ º¯ Êý £º 
     Public Function Replace(sIn As String, sFind As String, _ 
     sReplace As String, Optional nStart As Long = 1, _ 
     Optional nCount As Long = -1, Optional bCompare As _ 
     VbCompareMethod = vbBinaryCompare) As String 
     
     Dim nC As Long, nPos As Integer, sOut As String 
     sOut = sIn 
     nPos = InStr(nStart, sOut, sFind, bCompare) 
     If nPos = 0 Then GoTo EndFn: 
     Do 
     nC = nC + 1 
     sOut = Left(sOut, nPos - 1) & sReplace & _ 
     Mid(sOut, nPos + Len(sFind)) 
     If nCount <> -1 And nC >= nCount Then Exit Do 
     nPos = InStr(nStart, sOut, sFind, bCompare) 
     Loop While nPos > 0 
     EndFn: 
     Replace = sOut 
     End Function 
<END>