Dim ctr As Integer = 0
Do
Try
'
' 7/7/2010 spell out more...
File.Delete(UniquefileName) ' delete it if exists before writing to it...
Dim objStreamWriter As StreamWriter
objStreamWriter = File.CreateText(UniquefileName)
objStreamWriter.Write(strOutput)
'Close the stream
objStreamWriter.Close()
objStreamWriter = Nothing ' 7/7/2010 set to nothing
bSuccess = True
Exit Do
Catch ex As Exception
ctr = ctr + 1
If ctr = 100 Then
SendError("Path: " & strUrl & "<br>Error: " & ex.Message)
Exit Do
End If
End Try
Loop |