sdflh
This commit is contained in:
@@ -97,6 +97,23 @@ Public Class ImportZUGFeRDFiles
|
||||
Dim oSource = GetOriginalEmailPath(Args.OriginalEmailDirectory, MessageId)
|
||||
Dim oDestination = GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, oEmailData.Subject)
|
||||
|
||||
Dim oVersion As Integer = 0
|
||||
Dim oFileName As String = oDestination
|
||||
|
||||
Do While File.Exists(oFileName)
|
||||
If oVersion > 29 Then
|
||||
Throw New ApplicationException("Max. Move-Retries of 30 exceeded! Move will be aborted!")
|
||||
End If
|
||||
|
||||
oVersion += 1
|
||||
|
||||
Dim oDestinationDir = Path.GetDirectoryName(oDestination)
|
||||
Dim oExtension = Path.GetExtension(oFileName)
|
||||
Dim oRootName = Path.GetFileNameWithoutExtension(oFileName)
|
||||
Dim oNewName As String = oRootName & "~" & oVersion & oExtension
|
||||
oFileName = Path.Combine(oDestinationDir, oNewName)
|
||||
Loop
|
||||
|
||||
Try
|
||||
File.Move(oSource, oDestination)
|
||||
oEmailData.Attachment = oDestination
|
||||
|
||||
Reference in New Issue
Block a user