Private Sub SaveContents(html As String, url As String)
If String.IsNullOrEmpty(html) Then
Return
End If
Dim path As String = ""
SyncLock _locker
path = String.Format("{0}\{1}.txt", _path, System.Math.Max(System.Threading.Interlocked.Increment(_index),_index - 1))
End SyncLock
Try
Using fs As New StreamWriter(path)
fs.Write(html)
End Using
Catch ioe As IOException
MessageBox.Show("SaveContents IO" + ioe.Message & " path=" & path)
End Try
RaiseEvent ContentsSaved(path, url)
End Sub