SoFunction
Updated on 2025-04-13

Process function (ASP) to write text files


Sub Write2File(strFile, strContent, blnAppend)        

' Write to the file
' strFile File name (path) , content written by strContent, whether to append blnAppend
        On Error Resume Next 
        Set objFSO = ("") 
        If blnAppend Then 
                Set objWriteText = (strFile,8,True) 
        Else 
                Set objWriteText = (strFile,2,True) 
        End If 
         (strContent) 
        Set objWriteText = Nothing 
        Set objFSO = Nothing 
'Fault-tolerant processing
        Select Case Err 
Case 424  "The path is not found or the directory does not have write permissions."
'                Case Else   
                Case Else  Err 
        End Select 
End Sub