Message 1 of 39
Migrate files VB.NET
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Group,
I have a program that we use to copy and rename files. I need the program to automatically migrate any files that need migrated prior to manipulating them. I already have code to display a message box containing a list of the files that need migrated so I feel like most of the work is done. I just do not have the knowledge of where to start this. Can someone get me going in the right direction?
Here is the gist of what I have:
'Collection to store the filenames that need migrated to inform the user
Dim needsMigrated As New System.Collections.ArrayList
'Open the selected Files
openedDoc = apprentice.Open(selectedFile)
'Make sure the version is current
If openedDoc.NeedsMigrating = True Then
addUnmigratedFile(openedDoc.FullFileName)
End If
If needsMigrated.Count <> 0 Then
Call showUnmigrated()
End If
Private Sub addUnmigratedFile(ByVal unmigratedFile As String)
'Add the file to the needsMigrated collection to inform the user
needsMigrated.Add(unmigratedFile)
End Sub
Private Sub showUnmigrated()
Dim theFiles As String = needsMigrated.Item(0) & vbCrLf
For x As Integer = 1 To needsMigrated.Count - 1
theFiles += needsMigrated.Item(x) & vbCrLf
Next
MsgBox("The file(s) need updated to the current version:" & vbCrLf & theFiles, MsgBoxStyle.Exclamation)
Call resetForm()
End Sub
Thank you!
Chris