Gesamtsicherheiten
This commit is contained in:
@@ -1039,7 +1039,7 @@ Public Class frmStartOptions
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
cDHF_Anhaenge.SAVE()
|
||||
@@ -3197,7 +3197,9 @@ Public Class frmStartOptions
|
||||
|
||||
|
||||
Public Function copyFile(file, toDirectory, Optional ByRef dest = "")
|
||||
If Not System.IO.File.Exists(file) Then Return False
|
||||
Dim fileINfo As New FileInfo(file)
|
||||
If Not HasDirectoryReadAccess(fileINfo.DirectoryName) Then Return False
|
||||
If Not fileINfo.Exists Then Return False
|
||||
If Not System.IO.Directory.Exists(toDirectory) Then System.IO.Directory.CreateDirectory(toDirectory)
|
||||
dest = toDirectory & ".tmp_" & cut_file(file)
|
||||
Dim tmpExt = ""
|
||||
@@ -3211,6 +3213,23 @@ Public Class frmStartOptions
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Function HasDirectoryReadAccess(path As String) As Boolean
|
||||
Try
|
||||
If Not System.IO.Directory.Exists(path) Then Return False
|
||||
Dim entries = System.IO.Directory.EnumerateFileSystemEntries(path)
|
||||
Dim first = entries.FirstOrDefault()
|
||||
Return True
|
||||
Catch ex As UnauthorizedAccessException
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name, ERROR_OP.MAIL)
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name, ERROR_OP.MAIL)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function cut_file(ByVal file As String) As String ' Funktion zum Entfernen der Backslashs / Ordner While file.Contains("\") file = file.Remove(0, 1) End While Return file End Function
|
||||
While file.Contains("\")
|
||||
file = file.Remove(0, 1)
|
||||
|
||||
Reference in New Issue
Block a user