i am going crazy......
how can i loop through my result set and use File.Copy of File.Move to copy
or move the dim'd filename?????
i have tried AppendAllText, AppendText, Move, Copy, nothing works except the
first file. I understand that the destination must be named, but why can't
the destination name = my variable???
i know it works cuz i used the MsgBox's to verify.......
Imports System.IO
Imports System.Text
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim files As String() = Directory.GetFileSystemEntries("C:\parser")
Dim myfile As String
Dim destfile As Object
destfile = "C:\214\214"
Dim destfile1 As Object
destfile1 = "C:\858\858"
For Each myfile In files
Dim sr As New StreamReader(myfile)
Dim Filecontents As String = sr.ReadToEnd()
Try
If Filecontents.Contains("~214") Then
'File.Copy(myfile, destfile)
MsgBox("214 found")
Else : Filecontents.Contains("ST~858")
'File.Copy(myfile, destfile1)
MsgBox("858 found")
End If
Catch ex As Exception
MsgBox("exception")
End Try
Next
End Sub
End Class