Dim intFileIn As Integer
    Dim intFileOut As Integer
    Dim strTemp As String
    
    cd.Filter = "XML(*.xml)|*.xml|*.*|*.*"
    cd.Flags = &H2&
    cd.ShowOpen
    intFileIn = FreeFile
    intFileOut = FreeFile
    If cd.FileName = "" Then
        Exit Sub
    End If
    Open cd.FileName For Input As #intFileIn
    strTemp = ""
    strTemp = Input$(LOF(1), #intFileIn)   '出错语句
    Close #intFileIn
    Open cd.FileName For Output As #intFileOut
    strTemp = Trim(strTemp)
    strTemp = Left(strTemp, Len(strTemp) - 9)
    strTemp = strTemp & Chr(13) & Chr(10) & strString
    Print #intFileOut, strTemp & Chr(13) & Chr(10) & "</sqldef>",
    Close #intFileOut
上面的代码只能执行一次,执行第二次时就会出错.请高手们帮忙看看错在什么地方,是不是什么忘记关闭了?