title: how to move files one by one and rename it from a directory to another in vb.net
body: <p>To those who are knowledgeable here in vb.net please help me.</p>
  
  <p>i have to make a program that move images (in jpg) from a directory to another but before that it will first rename a file before moving it into the destination folder. i need it like this because each time it renames a file it'll save into the database (mysql)</p>
  
  <p>i have already a program that moves all jpg files into another directory but that's not what i need.</p>
  
  <p>please i need you're expertise and the codes. </p>
  
  <p>i'm not that good in vb.net</p>
  
  <hr>
  
  <p>The OP's move method from the comments:</p>
  
  <pre><code>Dim sourceDirectory As String = TextBox1.Text 
  Dim archiveDirectory As String = TextBox2.Text 
  Try 
      Dim jpgFiles = Directory.EnumerateFiles(sourceDirectory, "*.jpg") 
      For Each currentFile As String In jpgFiles 
          Dim fileName = currentFile.Substring(sourceDirectory.Length + 1) 
          Directory.Move(currentFile, Path.Combine(archiveDirectory, fileName)) 
      Next 
  Catch e As Exception 
      Console.WriteLine(e.Message) 
  End Try 
  </code></pre>