I am working on a program that takes PDF files, renames them and puts
them in the correct folder on our server. Currently, I have it set up
where the exe takes a command line argument of the filename to load
the PDF. The user drags and drops the PDF file onto the exe which
opens the program and loads the file.
The problem I am trying to fix is that I have a folder full of files
that need to be moved. This folder contains over 1000 files. It takes
a long time to do this because I am dragging and dropping a file to
open the program, then the program closes and I have to drag and drop
the next file which re-opens the program. Too much time. I want to
create an array of files or file names so that the user and "Save and
Go To Next File".
Currently I have written this to enumerate files into array:
Public aryFiles As IO.FileInfo()
Dim dir As New IO.DirectoryInfo(DOCUMENTFOLDER)
aryFiles = dir.GetFiles("*.pdf")
Dim curFile As New IO.FileInfo(DOCUMENTPATH)
I am having trouble determing the current file's location in the array
so that I can move to the next file in the list. I was trying:
curFileIndex = Array.IndexOf(aryFiles, curFile.Name)
to determine the index of the current file so I could add 1 to it and
move to the next one. But it's not working. Any ideas?