diff --git a/EnvelopeGenerator.Form/Controllers/BaseController.vb b/EnvelopeGenerator.Form/Controllers/BaseController.vb index c0d5675c..7591b0a1 100644 --- a/EnvelopeGenerator.Form/Controllers/BaseController.vb +++ b/EnvelopeGenerator.Form/Controllers/BaseController.vb @@ -145,7 +145,10 @@ Public MustInherit Class BaseController IO.File.Delete(pDocument.Filepath) End If Dim oFolder As String = Path.GetDirectoryName(pDocument.Filepath) - Directory.Delete(oFolder) + If Directory.Exists(oFolder) Then + Directory.Delete(oFolder) + End If + Return True Catch ex As Exception diff --git a/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb b/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb index f7c83895..f2e3518b 100644 --- a/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb +++ b/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb @@ -32,5 +32,5 @@ Imports System.Runtime.InteropServices ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' [assembly: AssemblyVersion("1.0.*")] - + diff --git a/EnvelopeGenerator.Form/My Project/Settings.Designer.vb b/EnvelopeGenerator.Form/My Project/Settings.Designer.vb index 00980999..a6e4647b 100644 --- a/EnvelopeGenerator.Form/My Project/Settings.Designer.vb +++ b/EnvelopeGenerator.Form/My Project/Settings.Designer.vb @@ -52,24 +52,6 @@ Partial Friend NotInheritable Class Settings Return defaultInstance End Get End Property - - _ - Public ReadOnly Property NetUse_Usr() As String - Get - Return CType(Me("NetUse_Usr"),String) - End Get - End Property - - _ - Public ReadOnly Property NetUse_PW() As String - Get - Return CType(Me("NetUse_PW"),String) - End Get - End Property End Class Namespace My diff --git a/EnvelopeGenerator.Form/My Project/Settings.settings b/EnvelopeGenerator.Form/My Project/Settings.settings index de4d6d30..8e615f25 100644 --- a/EnvelopeGenerator.Form/My Project/Settings.settings +++ b/EnvelopeGenerator.Form/My Project/Settings.settings @@ -1,12 +1,5 @@  - + - - - dd-san01\Administrator - - - sY4vnATDXwosbTJGip6SqA== - - + \ No newline at end of file diff --git a/EnvelopeGenerator.Form/app.config b/EnvelopeGenerator.Form/app.config index 54b00a41..a5b30491 100644 --- a/EnvelopeGenerator.Form/app.config +++ b/EnvelopeGenerator.Form/app.config @@ -2,19 +2,10 @@ -
- - - dd-san01\Administrator - - - sY4vnATDXwosbTJGip6SqA== - - System diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb index 67bb7898..48d4c601 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb @@ -357,88 +357,6 @@ Partial Public Class frmEnvelopeEditor End If End If End Sub - - - Function CopyFileWithNetUse(pSourcePath As String, pDestinationPath As String, pUsername As String, pPassword As String) As Boolean - Logger.Debug("EXECUTING CopyFileWithNetUse for " & pDestinationPath) - Dim oDirectoryExists As Boolean = False - Try - If Directory.Exists(pDestinationPath) Then - oDirectoryExists = True - End If - Catch ex As Exception - Logger.Warn("CopyFileWithNetUse - path not accessible or existing: {0}", ex.Message) - End Try - Logger.Debug("CopyFileWithNetUse - Folder accessible [{0}]", oDirectoryExists.ToString) - - If oDirectoryExists = False Then - Dim oDectryptedPW = Decryption.Decrypt(pPassword) - Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}" - Logger.Debug("netUseCommand " & netUseCommand) - Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") - processInfo.RedirectStandardOutput = True - processInfo.RedirectStandardInput = True - processInfo.UseShellExecute = False - processInfo.CreateNoWindow = True - Using oProcess As Process = Process.Start(processInfo) - oProcess.WaitForExit() - ' Prüfe den Rückgabewert des net use Befehls - If oProcess.ExitCode = 0 Then - ' Verschiebe die Datei - Try - Dim oReturn = COPY_TO_DMZ(pSourcePath, pDestinationPath) - oProcess.Close() - Return oReturn - Catch ex As Exception - oProcess.Close() - Logger.Warn("Unexpected error in CopyFileWithNetUse " & pDestinationPath) - MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in CopyFileWithNetUse") - - Return False - End Try - - Else - Logger.Warn("Error while connecting to network-path: " & pDestinationPath) - 'MsgBox("Error while connecting to network: " & pDestinationPath, MsgBoxStyle.Critical, "Unexpected error in CopyFileWithNetUse") - Return False - End If - End Using - Else - Return COPY_TO_DMZ(pSourcePath, pDestinationPath) - End If - - - - - End Function - Private Function COPY_TO_DMZ(pSourcePath As String, pDestinationPath As String) As Boolean - Try - Dim oFilename = System.IO.Path.GetFileName(pSourcePath) - Dim oFilePath As String = pSourcePath - Dim oSourceDirectory As String = Path.GetDirectoryName(oFilePath) - Dim split As String() = oFilePath.Split("\") - Dim parentFolder As String = split(split.Length - 2) - pDestinationPath &= "\" + parentFolder - If Not System.IO.Directory.Exists(pDestinationPath) Then - System.IO.Directory.CreateDirectory(pDestinationPath) - End If - pDestinationPath &= "\" + oFilename - If File.Exists(pDestinationPath) Then - File.Delete(pDestinationPath) - End If - Logger.Debug("Now copying file ...") - Logger.Debug("from [{0}] ", pSourcePath) - Logger.Debug("to [{0}]... ", pDestinationPath) - System.IO.File.Copy(pSourcePath, pDestinationPath) - Logger.Debug("Successfully Copied!") - Directory2Delete = oSourceDirectory - Return True - Catch ex As Exception - Logger.Warn("COPY_TO_DMZ - Unexpected error {0}", ex.Message) - Return False - End Try - - End Function Private Sub btnCancel_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnCancel.ItemClick ' Speichern? Dim oMessage = Resources.Envelope.Should_The_Envelope_Be_Saved