troubleshooting Question

fFile - move

Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America asked on
Visual Basic.NET
9 Comments1 Solution242 ViewsLast Modified:
how can I accomplish this code below

Dim Confm As String = Me.txtSearch.Text
        Dim myDir As DirectoryInfo = New DirectoryInfo("C:\Documents and Settings\Desktop\test\")
        Dim myfile As FileInfo
        Dim found As Boolean = False



 For Each myfile In myDir.GetFiles("*.txt")
            If myfile.Name = Trim(Confm) & ".txt" Then

                found = True
                MessageBox.Show(myfile.Name & " - " & "Found")
                MessageBox.Show("Do you want to move it?", "Confirmation Number", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)

            if ok is selected, move to Test2   <-----------------------------------

                myfile.MoveTo("C:\Documents and Settings\test2\" & myfile.Name)

            if cancel is seleted, do nothing    <-----------------------------------



                Exit For


            End If
ASKER CERTIFIED SOLUTION
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros