System.IO, Zugferd
This commit is contained in:
@@ -157,12 +157,12 @@ Public Class cProgrammeUpdate
|
||||
|
||||
Dim LIST_SOURCE As New List(Of VERAG_PROG_ALLGEMEIN.cProgrammeUpdate)
|
||||
Dim dirNameReplace_SOURCE = ""
|
||||
Dim DI_SOURCE As New IO.DirectoryInfo(sourcePfad)
|
||||
Dim DI_SOURCE As New System.IO.DirectoryInfo(sourcePfad)
|
||||
RekursivGetFiles(DI_SOURCE, dirNameReplace_SOURCE, LIST_SOURCE, {})
|
||||
|
||||
Dim LIST_DEST As New List(Of VERAG_PROG_ALLGEMEIN.cProgrammeUpdate)
|
||||
Dim dirNameReplace_DEST = ""
|
||||
Dim DI_DEST As New IO.DirectoryInfo(destPfad)
|
||||
Dim DI_DEST As New System.IO.DirectoryInfo(destPfad)
|
||||
RekursivGetFiles(DI_DEST, dirNameReplace_DEST, LIST_DEST, ignoreFilesBeginWith)
|
||||
|
||||
If LIST_SOURCE.Count = 0 Then
|
||||
@@ -175,8 +175,8 @@ Public Class cProgrammeUpdate
|
||||
'ORDNER erstellen:
|
||||
For Each f In LIST_SOURCE
|
||||
If If(f.pud_filePathFolder, "") <> "" Then
|
||||
If Not IO.Directory.Exists(dirNameReplace_DEST & "\" & f.pud_filePathFolder) Then '.Replace("\\", "\")
|
||||
IO.Directory.CreateDirectory(dirNameReplace_DEST & "\" & f.pud_filePathFolder) '.Replace("\\", "\")
|
||||
If Not System.IO.Directory.Exists(dirNameReplace_DEST & "\" & f.pud_filePathFolder) Then '.Replace("\\", "\")
|
||||
System.IO.Directory.CreateDirectory(dirNameReplace_DEST & "\" & f.pud_filePathFolder) '.Replace("\\", "\")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -184,7 +184,7 @@ Public Class cProgrammeUpdate
|
||||
'Löschen der unbenötigten Files:
|
||||
For Each f In LIST_DEST
|
||||
If isOldFile(f, LIST_SOURCE) Then
|
||||
IO.File.Delete(dirNameReplace_DEST & "\" & If(f.pud_filePathFolder, "") & "\" & f.pud_fileName) '.Replace("\\", "\")
|
||||
System.IO.File.Delete(dirNameReplace_DEST & "\" & If(f.pud_filePathFolder, "") & "\" & f.pud_fileName) '.Replace("\\", "\")
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -195,7 +195,7 @@ Public Class cProgrammeUpdate
|
||||
Dim s_path = dirNameReplace_SOURCE & "\" & If(f.pud_filePathFolder, "") & "\" & f.pud_fileName '.Replace("\\", "\")
|
||||
Dim d_path = dirNameReplace_DEST & "\" & If(f.pud_filePathFolder, "") & "\" & f.pud_fileName '.Replace("\\", "\")
|
||||
d_path = d_path '.replace("\\", "\")
|
||||
IO.File.Copy(s_path, d_path)
|
||||
System.IO.File.Copy(s_path, d_path)
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -214,8 +214,8 @@ Public Class cProgrammeUpdate
|
||||
Return False
|
||||
End Function
|
||||
Public Shared Sub RekursivGetFiles(ByVal oDir As System.IO.DirectoryInfo, ByRef dirNameReplace As String, ByRef LIST As List(Of VERAG_PROG_ALLGEMEIN.cProgrammeUpdate), ignoreFilesBeginWith As String())
|
||||
Dim oSubDir As IO.DirectoryInfo
|
||||
Dim FI As IO.FileInfo
|
||||
Dim oSubDir As System.IO.DirectoryInfo
|
||||
Dim FI As System.IO.FileInfo
|
||||
|
||||
' zunächst alle Dateien des Ordners aufspüren
|
||||
For Each FI In oDir.GetFiles()
|
||||
|
||||
@@ -237,7 +237,7 @@ Public Class cRMC
|
||||
VERARBEITUNG_PFAD = cRMC.Paramter.GET_PARAM_ByName("VERARBEITUNG_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||
ZIEL_PFAD = cRMC.Paramter.GET_PARAM_ByName("ZIEL_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||
PDFRECHNUNGEN = cRMC.Paramter.GET_PARAM_ByName("PDFRECHNUNGEN", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||
If Not IO.Directory.Exists(VERARBEITUNG_PFAD) Then IO.Directory.CreateDirectory(VERARBEITUNG_PFAD)
|
||||
If Not System.IO.Directory.Exists(VERARBEITUNG_PFAD) Then System.IO.Directory.CreateDirectory(VERARBEITUNG_PFAD)
|
||||
|
||||
Return Paramter.getFTPConenction(API_STRING, API, programName)
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ Public Class cDATENSERVER
|
||||
' My.Computer.FileSystem.RenameDirectory(oldDIR, newname)
|
||||
For Each li In DATA_LIST.LIST
|
||||
Dim newPfad = li.coll_pfad.Replace(oldDIR, newDIR)
|
||||
If Not IO.Directory.Exists(newDIR) Then IO.Directory.CreateDirectory(newDIR)
|
||||
If Not System.IO.Directory.Exists(newDIR) Then System.IO.Directory.CreateDirectory(newDIR)
|
||||
My.Computer.FileSystem.CopyFile(li.coll_pfad, newPfad, True)
|
||||
My.Computer.FileSystem.DeleteFile(li.coll_pfad)
|
||||
li.coll_pfad = newPfad
|
||||
@@ -197,11 +197,11 @@ Public Class cDATENSERVER
|
||||
Dim newPfad = li.coll_pfad.Replace(oldDIR, newDIR)
|
||||
'MsgBox(li.coll_pfad)
|
||||
' MsgBox(newPfad)
|
||||
If Not IO.Directory.Exists(newDIR) Then IO.Directory.CreateDirectory(newDIR)
|
||||
If Not System.IO.Directory.Exists(newDIR) Then System.IO.Directory.CreateDirectory(newDIR)
|
||||
Try
|
||||
If Not li.coll_pfad.ToLower.StartsWith("\\stor01.verag.ost.dmn\datenarchivarchiv") Then
|
||||
If Not li.coll_pfad.Contains("?") Then
|
||||
If IO.File.Exists(li.coll_pfad) Then
|
||||
If System.IO.File.Exists(li.coll_pfad) Then
|
||||
My.Computer.FileSystem.CopyFile(li.coll_pfad, newPfad, True)
|
||||
My.Computer.FileSystem.DeleteFile(li.coll_pfad)
|
||||
li.coll_pfad = newPfad
|
||||
@@ -301,7 +301,7 @@ Public Class cDATENSERVER
|
||||
|
||||
Public Function uploadDataToDATENSERVER(srcPath, Optional bezeichnung = "", Optional endung = "", Optional allowMsg = True, Optional coll_archiv = False, Optional delteFromFileSystem = True, Optional enableOverwritting = False) As Boolean
|
||||
'LAST_ID = -1
|
||||
If endung = "" Then Dim fi As New IO.DirectoryInfo(srcPath) : endung = fi.Extension
|
||||
If endung = "" Then Dim fi As New System.IO.DirectoryInfo(srcPath) : endung = fi.Extension
|
||||
' If bezeichnung = "" Then bezeichnung = System.IO.Path.GetFileName(srcPath) : endung = ""
|
||||
If bezeichnung = "" Then bezeichnung = da_name
|
||||
|
||||
@@ -328,7 +328,7 @@ Public Class cDATENSERVER
|
||||
Public Function insertDataToDATENSERVER(srcPath, Optional bezeichnung = "", Optional endung = "", Optional allowMsg = True, Optional coll_archiv = False) As Boolean
|
||||
'Datei musss schon am Datenserver liegen, wird nciht mehr kopiert!!!!!
|
||||
|
||||
If endung = "" Then Dim fi As New IO.DirectoryInfo(srcPath) : endung = fi.Extension
|
||||
If endung = "" Then Dim fi As New System.IO.DirectoryInfo(srcPath) : endung = fi.Extension
|
||||
' If bezeichnung = "" Then bezeichnung = System.IO.Path.GetFileName(srcPath) : endung = ""
|
||||
If bezeichnung = "" Then bezeichnung = da_name
|
||||
replaceInvalidCahr(bezeichnung)
|
||||
@@ -552,15 +552,15 @@ Public Class cDATENSERVER
|
||||
|
||||
|
||||
' Dim srcPath = SQL.getValueTxtBySql("SELECT TOP 1 isnull([coll_pfad],'') FROM [tblDatenarchiv] INNER JOIN [tblDatenarchiv_Collection] ON [da_id]=[coll_daId] WHERE da_id='" & da_id & "' ", "FMZOLL")
|
||||
' If Not IO.File.Exists(srcPath) Then MsgBox("Die Datei existiert nicht") : Exit Function
|
||||
' If Not System.IO.File.Exists(srcPath) Then MsgBox("Die Datei existiert nicht") : Exit Function
|
||||
|
||||
' Dim fi As New IO.DirectoryInfo(srcPath)
|
||||
' Dim fi As New System.IO.DirectoryInfo(srcPath)
|
||||
' Dim destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension)
|
||||
|
||||
|
||||
|
||||
|
||||
' IO.File.Copy(srcPath, destPath, True)
|
||||
' System.IO.File.Copy(srcPath, destPath, True)
|
||||
|
||||
' Process.Start(destPath)
|
||||
|
||||
@@ -578,7 +578,7 @@ Public Class cDATENSERVER
|
||||
' Dim path = SQL.getValueTxtBySql("SELECT TOP 1 isnull([coll_pfad],'') FROM [tblDatenarchiv] INNER JOIN [tblDatenarchiv_Collection] ON [da_id]=[coll_daId] WHERE da_id='" & da_id & "' ", "FMZOLL")
|
||||
'If path.Contains(rootDir) Then 'Um sicher zu gehen, dass der pfad im richtigem VZ ist.
|
||||
' saveFileToDel(path)
|
||||
' IO.File.Delete(path)
|
||||
' System.IO.File.Delete(path)
|
||||
'End If
|
||||
SQL.doSQL("DELETE FROM [tblDatenarchiv] WHERE [da_id]=" & Me.da_id & " ", "FMZOLL")
|
||||
'SQL.doSQL("DELETE FROM [tblDatenarchiv_Collection] WHERE [coll_daId]=" & id & " ", "FMZOLL")
|
||||
@@ -857,7 +857,7 @@ Public Class cFormularManager
|
||||
Dim path_src = DS.OPEN_SINGLE(False)
|
||||
If path_src = "" Then Return ""
|
||||
|
||||
Dim fi As New IO.DirectoryInfo(path_src)
|
||||
Dim fi As New System.IO.DirectoryInfo(path_src)
|
||||
Dim destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension, True, False)
|
||||
Dim pdf As iTextSharp.text.pdf.PdfReader = New iTextSharp.text.pdf.PdfReader(path_src)
|
||||
Using fw As New FileStream(destPath, FileMode.OpenOrCreate)
|
||||
@@ -981,7 +981,7 @@ Public Class cFormularManager
|
||||
Dim path_src = DS.OPEN_SINGLE(False)
|
||||
If path_src = "" Then Return list
|
||||
|
||||
Dim fi As New IO.DirectoryInfo(path_src)
|
||||
Dim fi As New System.IO.DirectoryInfo(path_src)
|
||||
Dim destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension, True, False)
|
||||
Dim pdf As iTextSharp.text.pdf.PdfReader = New iTextSharp.text.pdf.PdfReader(path_src)
|
||||
|
||||
@@ -1037,7 +1037,7 @@ Public Class cFormularManager
|
||||
path_src = vorhandenesLokalesPDF_Path
|
||||
End If
|
||||
|
||||
Dim fi As New IO.DirectoryInfo(path_src)
|
||||
Dim fi As New System.IO.DirectoryInfo(path_src)
|
||||
Dim destPath = ""
|
||||
destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension, True, False)
|
||||
|
||||
@@ -1730,7 +1730,7 @@ Public Class cDatenarchiv_Collection
|
||||
If My.Computer.FileSystem.FileExists(coll_pfad) Then
|
||||
saveFileToDel(coll_pfad)
|
||||
Try
|
||||
IO.File.Delete(coll_pfad)
|
||||
System.IO.File.Delete(coll_pfad)
|
||||
Catch : End Try
|
||||
Return SQL.doSQL("DELETE FROM [tblDatenarchiv_Collection] WHERE [coll_id]=" & coll_id & " ", "FMZOLL")
|
||||
Else
|
||||
@@ -1751,8 +1751,8 @@ Public Class cDatenarchiv_Collection
|
||||
delPath = path.Replace("\DATENARCHIV\", "\DATENARCHIV\DELETE\")
|
||||
'\\192.168.0.91\Datenarchiv\DOKUMENTE\VORLAGEN\FISKALSCHREIBEN
|
||||
End If
|
||||
If Not IO.Directory.Exists(delPath.Substring(0, delPath.LastIndexOf("\"))) Then IO.Directory.CreateDirectory(delPath.Substring(0, delPath.LastIndexOf("\")))
|
||||
If IO.File.Exists(delPath) Then
|
||||
If Not System.IO.Directory.Exists(delPath.Substring(0, delPath.LastIndexOf("\"))) Then System.IO.Directory.CreateDirectory(delPath.Substring(0, delPath.LastIndexOf("\")))
|
||||
If System.IO.File.Exists(delPath) Then
|
||||
If delPath.Contains(".") Then
|
||||
Dim commaIndex = delPath.LastIndexOf(".")
|
||||
delPath = delPath.Substring(0, commaIndex) + Now.ToString("_del_ddMMyyyy_HHmmss") + delPath.Substring(commaIndex) ' + 1)
|
||||
@@ -1761,7 +1761,7 @@ Public Class cDatenarchiv_Collection
|
||||
' delPath.Replace(".", Now.ToString("_ddMMyyyy_HHmmss") & ".")
|
||||
End If
|
||||
End If
|
||||
IO.File.Copy(path, delPath)
|
||||
System.IO.File.Copy(path, delPath)
|
||||
End Sub
|
||||
|
||||
Function INSERT() As Integer
|
||||
@@ -1816,9 +1816,9 @@ Public Class cDatenarchiv_Collection
|
||||
End Function
|
||||
|
||||
Public Function OPEN(Optional openFILE As Boolean = True, Optional useBezeichnung As Boolean = False) As String
|
||||
If Not IO.File.Exists(coll_pfad) Then MsgBox("Die Datei existiert nicht") : Return ""
|
||||
If Not System.IO.File.Exists(coll_pfad) Then MsgBox("Die Datei existiert nicht") : Return ""
|
||||
|
||||
Dim fi As New IO.DirectoryInfo(coll_pfad)
|
||||
Dim fi As New System.IO.DirectoryInfo(coll_pfad)
|
||||
Dim destPath = ""
|
||||
If useBezeichnung Then
|
||||
destPath = DATENVERVER_OPTIONS.copyToTmp_KeepFilename(coll_pfad, coll_bezeichnung)
|
||||
@@ -1826,14 +1826,14 @@ Public Class cDatenarchiv_Collection
|
||||
destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension, , False)
|
||||
End If
|
||||
' MsgBox(destPath)
|
||||
IO.File.Copy(coll_pfad, destPath, True)
|
||||
System.IO.File.Copy(coll_pfad, destPath, True)
|
||||
If openFILE Then Process.Start(destPath)
|
||||
Return destPath
|
||||
End Function
|
||||
|
||||
|
||||
Public Function OPEN_ORIG(Optional openFILE As Boolean = True) As String
|
||||
If Not IO.File.Exists(coll_pfad) Then MsgBox("Die Datei existiert nicht") : Return ""
|
||||
If Not System.IO.File.Exists(coll_pfad) Then MsgBox("Die Datei existiert nicht") : Return ""
|
||||
|
||||
If openFILE Then Process.Start(coll_pfad)
|
||||
Return coll_pfad
|
||||
@@ -1944,7 +1944,7 @@ Public Class cDatenserverIDCollectionList
|
||||
Function COPY_FILE(srcPath, destPath, ByRef errorMsg) As Boolean
|
||||
For i = 1 To 3 '3 Versuche
|
||||
Try
|
||||
IO.File.Copy(srcPath, destPath, True) ' Kopiert die Dateien Next
|
||||
System.IO.File.Copy(srcPath, destPath, True) ' Kopiert die Dateien Next
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
errorMsg = ex.Message
|
||||
@@ -2014,7 +2014,7 @@ Public Class DATENVERVER_OPTIONS
|
||||
TMP_PATH = Path.GetTempPath() & "\VERAG\DatenTMP\"
|
||||
End If
|
||||
|
||||
' If Not IO.Directory.Exists(TMP_PATH) Then IO.Directory.CreateDirectory(TMP_PATH)
|
||||
' If Not System.IO.Directory.Exists(TMP_PATH) Then System.IO.Directory.CreateDirectory(TMP_PATH)
|
||||
|
||||
Dim TMP_PATH2 = TMP_PATH & If(unterOrdner <> "", "\" & unterOrdner & "\", "")
|
||||
TMP_PATH2 = TMP_PATH2.replace("\\", "\")
|
||||
@@ -2035,7 +2035,7 @@ Public Class DATENVERVER_OPTIONS
|
||||
Dim destPath = TMP_PATH2 & name
|
||||
If special Then destPath = TMP_PATH2 & name & "_" & Now.ToString("yyyyMMddHHmmssfff") & extension
|
||||
|
||||
While IO.File.Exists(destPath)
|
||||
While System.IO.File.Exists(destPath)
|
||||
destPath = TMP_PATH2 & name & "_" & Now.ToString("yyyyMMddHHmmssfff") & extension
|
||||
End While
|
||||
|
||||
@@ -2046,11 +2046,11 @@ Public Class DATENVERVER_OPTIONS
|
||||
Dim DS As New cDATENSERVER(dId)
|
||||
Dim pfad As String = DS.GET_TOP1_PATH
|
||||
If pfad = "" Then Return ""
|
||||
Dim fi As New IO.FileInfo(pfad)
|
||||
Dim fi As New System.IO.FileInfo(pfad)
|
||||
|
||||
Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(bezeichnung, fi.Extension,, False, "ClipBoard_TMP\ClipBoard_" & Now.ToString("ddMMyyyyHHmmss_sss") & "\")
|
||||
Try
|
||||
IO.File.Copy(pfad, tmpPath)
|
||||
System.IO.File.Copy(pfad, tmpPath)
|
||||
Return tmpPath
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
@@ -2059,10 +2059,10 @@ Public Class DATENVERVER_OPTIONS
|
||||
End Function
|
||||
|
||||
Shared Function copyToTmp_KeepFilename(pfad As String, bezeichnung As String) As String
|
||||
Dim fi As New IO.FileInfo(pfad)
|
||||
Dim fi As New System.IO.FileInfo(pfad)
|
||||
Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(bezeichnung, fi.Extension,, False, "ClipBoard_TMP\ClipBoard_" & Now.ToString("ddMMyyyyHHmmss_sss") & "\")
|
||||
Try
|
||||
IO.File.Copy(pfad, tmpPath)
|
||||
System.IO.File.Copy(pfad, tmpPath)
|
||||
Return tmpPath
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
@@ -2073,12 +2073,12 @@ Public Class DATENVERVER_OPTIONS
|
||||
Shared Function getTMPAbsolutePath(AbsolutePath As String, extension As String, Optional special As Boolean = False, Optional delete As Boolean = True) As String
|
||||
|
||||
If delete Then
|
||||
Try : IO.File.Delete(AbsolutePath) : Catch ex As Exception : End Try
|
||||
Try : System.IO.File.Delete(AbsolutePath) : Catch ex As Exception : End Try
|
||||
End If
|
||||
Dim destPath = AbsolutePath
|
||||
If special Then destPath = AbsolutePath.Replace(extension, "") & "_" & Now.ToString("yyyyMMddHHmmssfff") & extension
|
||||
|
||||
While IO.File.Exists(destPath)
|
||||
While System.IO.File.Exists(destPath)
|
||||
destPath = AbsolutePath.Replace(extension, "") & "_" & Now.ToString("yyyyMMddHHmmssfff") & extension
|
||||
End While
|
||||
|
||||
@@ -2090,11 +2090,11 @@ Public Class DATENVERVER_OPTIONS
|
||||
Dim TMP_PATH2 As String = TMP_PATH & If(unterOrdner <> "", "\" & unterOrdner & "\", "")
|
||||
TMP_PATH2 = TMP_PATH2.Replace("\\", "\")
|
||||
If My.Computer.FileSystem.DirectoryExists(TMP_PATH2) Then
|
||||
For Each file As String In IO.Directory.GetFiles(TMP_PATH2) ' Ermittelt alle Dateien des Ordners und löscht diese (sind tmp)
|
||||
Try : IO.File.Delete(file) : Catch : End Try
|
||||
For Each file As String In System.IO.Directory.GetFiles(TMP_PATH2) ' Ermittelt alle Dateien des Ordners und löscht diese (sind tmp)
|
||||
Try : System.IO.File.Delete(file) : Catch : End Try
|
||||
Next
|
||||
For Each dir As String In IO.Directory.GetDirectories(TMP_PATH2) ' Ermittelt alle Dateien des Ordners und löscht diese (sind tmp)
|
||||
Try : IO.Directory.Delete(dir, True) : Catch : End Try
|
||||
For Each dir As String In System.IO.Directory.GetDirectories(TMP_PATH2) ' Ermittelt alle Dateien des Ordners und löscht diese (sind tmp)
|
||||
Try : System.IO.Directory.Delete(dir, True) : Catch : End Try
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
@@ -2111,7 +2111,7 @@ Public Class DATENVERVER_OPTIONS
|
||||
|
||||
'Dim oldDIR = getDescPath(initRootDir(), kategorie, ordner, da_uOrdner1, da_uOrdner2, da_uOrdner3, kdnr, "", "", True)
|
||||
' Dim DS As New cDATENSERVER(kategorie, ordner, da_uOrdner1, da_uOrdner2, da_uOrdner3, da_name, kdnr)
|
||||
'If IO.Directory.Exists(oldDIR) Then
|
||||
'If System.IO.Directory.Exists(oldDIR) Then
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim dt As DataTable = Nothing
|
||||
|
||||
@@ -2209,11 +2209,11 @@ Public Class DATENVERVER_OPTIONS
|
||||
dir &= If(da_uOrdner2 IsNot Nothing AndAlso da_uOrdner2 <> "", da_uOrdner2 & "\", "")
|
||||
dir &= If(da_uOrdner3 IsNot Nothing AndAlso da_uOrdner3 <> "", da_uOrdner3 & "\", "")
|
||||
If Not onlyordner Then
|
||||
If Not IO.Directory.Exists(dir) Then
|
||||
IO.Directory.CreateDirectory(dir)
|
||||
If Not System.IO.Directory.Exists(dir) Then
|
||||
System.IO.Directory.CreateDirectory(dir)
|
||||
End If
|
||||
Dim zusatz = "" : Dim zusatzcnt = 1
|
||||
While IO.File.Exists(dir & dateiName & zusatz & If(bezeichnung.ToString.EndsWith(endung), "", endung))
|
||||
While System.IO.File.Exists(dir & dateiName & zusatz & If(bezeichnung.ToString.EndsWith(endung), "", endung))
|
||||
zusatz = "_" & zusatzcnt
|
||||
zusatzcnt += 1
|
||||
End While
|
||||
@@ -2224,7 +2224,7 @@ Public Class DATENVERVER_OPTIONS
|
||||
Return dir
|
||||
Else
|
||||
If Not onlyordner Then
|
||||
If Not IO.Directory.Exists(rootDir & "DOKUMENTE\KEINE_ZUORDNUNG\" & kdnr_path & "\") Then IO.Directory.CreateDirectory(rootDir & "DOKUMENTE\KEINE_ZUORDNUNG\" & kdnr_path & "\")
|
||||
If Not System.IO.Directory.Exists(rootDir & "DOKUMENTE\KEINE_ZUORDNUNG\" & kdnr_path & "\") Then System.IO.Directory.CreateDirectory(rootDir & "DOKUMENTE\KEINE_ZUORDNUNG\" & kdnr_path & "\")
|
||||
End If
|
||||
Return rootDir & "DOKUMENTE\KEINE_ZUORDNUNG\" & kdnr_path & "\" & dateiName
|
||||
End If
|
||||
@@ -2235,11 +2235,11 @@ Public Class DATENVERVER_OPTIONS
|
||||
End Function
|
||||
Shared Function OPEN_PATH(path As String) As Boolean
|
||||
Try
|
||||
If Not IO.File.Exists(path) Then MsgBox("Die Datei existiert nicht") : Return False
|
||||
Dim fi As New IO.DirectoryInfo(path)
|
||||
If Not System.IO.File.Exists(path) Then MsgBox("Die Datei existiert nicht") : Return False
|
||||
Dim fi As New System.IO.DirectoryInfo(path)
|
||||
Dim destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension, , False)
|
||||
|
||||
IO.File.Copy(path, destPath, True)
|
||||
System.IO.File.Copy(path, destPath, True)
|
||||
Process.Start(destPath)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -60,7 +60,7 @@ Public Class frmMessenger
|
||||
EMOJI_PATH = "\\192.168.100.20\Share\Programme\CHAT_EMOJIS\"
|
||||
End If
|
||||
|
||||
If Not IO.Directory.Exists(EMOJI_PATH) Then
|
||||
If Not System.IO.Directory.Exists(EMOJI_PATH) Then
|
||||
EMOJI_PATH = EMOJI_PATH_MAIN
|
||||
End If
|
||||
|
||||
@@ -132,15 +132,15 @@ Public Class frmMessenger
|
||||
FlowLayoutPanel.Controls.Clear()
|
||||
If alloweasteregg Then pic.Visible = False
|
||||
|
||||
' If IO.Directory.Exists(My.Application.roo "") Then
|
||||
' If System.IO.Directory.Exists(My.Application.roo "") Then
|
||||
|
||||
Dim spezialEmoji = False
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME = "ADMIN" Then spezialEmoji = True
|
||||
|
||||
If IO.Directory.Exists(EMOJI_PATH) Then
|
||||
For Each aa In IO.Directory.GetFiles(EMOJI_PATH) '.OrderBy(Function(f) f)
|
||||
If System.IO.Directory.Exists(EMOJI_PATH) Then
|
||||
For Each aa In System.IO.Directory.GetFiles(EMOJI_PATH) '.OrderBy(Function(f) f)
|
||||
If (alloweasteregg Or Not aa.Contains("easteregg")) Then
|
||||
If IO.File.Exists(aa) And aa.Contains(".png") And (aa.Contains("emoji_") Or spezialEmoji) Then
|
||||
If System.IO.File.Exists(aa) And aa.Contains(".png") And (aa.Contains("emoji_") Or spezialEmoji) Then
|
||||
If hiddemEmojis Or Not aa.Contains("_hidden") Then
|
||||
Dim p As New PictureBox
|
||||
p.Size = New Size(40, 40)
|
||||
@@ -169,14 +169,14 @@ Public Class frmMessenger
|
||||
' FlowLayoutPanel.Controls.Clear()
|
||||
' If alloweasteregg Then pic.Visible = False
|
||||
|
||||
' If IO.Directory.Exists(DATENVERVER_OPTIONS.getRootDir & "\DOKUMENTE\CHAT_EMOJIS\") Then
|
||||
' If System.IO.Directory.Exists(DATENVERVER_OPTIONS.getRootDir & "\DOKUMENTE\CHAT_EMOJIS\") Then
|
||||
' Dim EmojiPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "CHAT_EMOJIS\"
|
||||
' If Not IO.Directory.Exists(EmojiPath) Then IO.Directory.CreateDirectory(EmojiPath)
|
||||
' If Not System.IO.Directory.Exists(EmojiPath) Then System.IO.Directory.CreateDirectory(EmojiPath)
|
||||
|
||||
' If VERAG_PROG_ALLGEMEIN.cProgrammeUpdate.copyProgramLIST(DATENVERVER_OPTIONS.getRootDir & "\DOKUMENTE\CHAT_EMOJIS\", EmojiPath, {}) Then
|
||||
' For Each a In IO.Directory.GetFiles(EmojiPath) '.OrderBy(Function(f) f)
|
||||
' For Each a In System.IO.Directory.GetFiles(EmojiPath) '.OrderBy(Function(f) f)
|
||||
' If alloweasteregg Or Not a.Contains("easteregg") Then
|
||||
' If IO.File.Exists(a) And a.Contains(".png") And a.Contains("emoji_") Then
|
||||
' If System.IO.File.Exists(a) And a.Contains(".png") And a.Contains("emoji_") Then
|
||||
|
||||
' Dim p As New PictureBox
|
||||
' p.Size = New Size(40, 40)
|
||||
@@ -945,7 +945,7 @@ Public Class frmMessenger
|
||||
|
||||
If fd.ShowDialog() = System.Windows.Forms.DialogResult.OK And fd.FileName <> "" Then
|
||||
saveFileAtt(fd.FileName)
|
||||
'Dim fileName = New IO.FileInfo(fd.FileName).Name
|
||||
'Dim fileName = New System.IO.FileInfo(fd.FileName).Name
|
||||
'Dim docId = -1
|
||||
'If saveToDS(fileName, fd.FileName, docId) Then
|
||||
|
||||
@@ -971,7 +971,7 @@ Public Class frmMessenger
|
||||
End Sub
|
||||
|
||||
Sub saveFileAtt(filePath, Optional reloadChat = True)
|
||||
Dim fileName = New IO.FileInfo(filePath).Name
|
||||
Dim fileName = New System.IO.FileInfo(filePath).Name
|
||||
Dim docId = -1
|
||||
If saveToDS(fileName, filePath, docId) Then
|
||||
|
||||
@@ -995,7 +995,7 @@ Public Class frmMessenger
|
||||
End If
|
||||
End Sub
|
||||
Sub saveEmoji(filePath)
|
||||
' Dim fileName = New IO.FileInfo(filePath).Name
|
||||
' Dim fileName = New System.IO.FileInfo(filePath).Name
|
||||
'Dim docId = -1
|
||||
'If saveToDS(fileName, filePath, docId) Then
|
||||
|
||||
@@ -1170,9 +1170,9 @@ Public Class frmMessenger
|
||||
Dim grabpicture As System.Drawing.Image
|
||||
|
||||
grabpicture = My.Computer.Clipboard.GetImage()
|
||||
Dim imagePath = IO.Path.GetTempPath & "\Screenshot_" & Now.ToString("ddMMyyyy_HHmmss") & ".jpg"
|
||||
While IO.File.Exists(imagePath)
|
||||
imagePath = IO.Path.GetTempPath & "\Screenshot_" & Now.ToString("ddMMyyyy_HHmmss") & ".jpg"
|
||||
Dim imagePath = System.IO.Path.GetTempPath & "\Screenshot_" & Now.ToString("ddMMyyyy_HHmmss") & ".jpg"
|
||||
While System.IO.File.Exists(imagePath)
|
||||
imagePath = System.IO.Path.GetTempPath & "\Screenshot_" & Now.ToString("ddMMyyyy_HHmmss") & ".jpg"
|
||||
End While
|
||||
grabpicture.Save(imagePath)
|
||||
saveFileAtt(imagePath, False)
|
||||
@@ -1182,7 +1182,7 @@ Public Class frmMessenger
|
||||
' Dim F_listItem As String = Path.Combine("c:\mynewpath", Path.GetFileName(s))
|
||||
' File.Copy(s, newFile)
|
||||
' MsgBox(s)
|
||||
If IO.File.Exists(s) Then
|
||||
If System.IO.File.Exists(s) Then
|
||||
saveFileAtt(s, False)
|
||||
added = True
|
||||
End If
|
||||
|
||||
@@ -46,7 +46,7 @@ Public Class usrCntlMessenger_ChatEmoji
|
||||
Try
|
||||
'Dim frmM As frmMessenger = DirectCast(Me.Parent, frmMessenger)
|
||||
If frmM.EMOJI_PATH <> frmM.EMOJI_PATH_MAIN Then
|
||||
If IO.File.Exists(imgPath.Replace(frmM.EMOJI_PATH_MAIN, frmM.EMOJI_PATH)) Then
|
||||
If System.IO.File.Exists(imgPath.Replace(frmM.EMOJI_PATH_MAIN, frmM.EMOJI_PATH)) Then
|
||||
imgPath = imgPath.Replace(frmM.EMOJI_PATH_MAIN, frmM.EMOJI_PATH)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -161,7 +161,7 @@ Public Class frmMitarbeitersucheBearbeiten
|
||||
|
||||
If fd.ShowDialog() = DialogResult.OK AndAlso fd.FileName <> "" Then
|
||||
|
||||
Dim Extension = New IO.FileInfo(fd.FileName).Extension
|
||||
Dim Extension = New System.IO.FileInfo(fd.FileName).Extension
|
||||
Dim docId = -1
|
||||
If saveToDS(Extension, fd.FileName, "FRONT", docId) Then
|
||||
|
||||
@@ -204,7 +204,7 @@ Public Class frmMitarbeitersucheBearbeiten
|
||||
|
||||
If fd.ShowDialog() = DialogResult.OK AndAlso fd.FileName <> "" Then
|
||||
|
||||
Dim Extension = New IO.FileInfo(fd.FileName).Extension
|
||||
Dim Extension = New System.IO.FileInfo(fd.FileName).Extension
|
||||
Dim docId = -1
|
||||
If saveToDS(Extension, fd.FileName, "HOVER1", docId) Then
|
||||
|
||||
@@ -229,7 +229,7 @@ Public Class frmMitarbeitersucheBearbeiten
|
||||
|
||||
If fd.ShowDialog() = DialogResult.OK AndAlso fd.FileName <> "" Then
|
||||
|
||||
Dim Extension = New IO.FileInfo(fd.FileName).Extension
|
||||
Dim Extension = New System.IO.FileInfo(fd.FileName).Extension
|
||||
Dim docId = -1
|
||||
If saveToDS(Extension, fd.FileName, "HOVER2", docId) Then
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
'path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir
|
||||
'pathArchivKD = ""
|
||||
End If
|
||||
If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If Not System.IO.Directory.Exists(pathKD) Then System.IO.Directory.CreateDirectory(pathKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -93,14 +93,14 @@
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchivKD <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then System.IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(pathKD & DateinameKD)
|
||||
Else
|
||||
IO.File.Delete(pathKD & DateinameKD)
|
||||
System.IO.File.Delete(pathKD & DateinameKD)
|
||||
End If
|
||||
|
||||
updateFibu() ' UPDATE FiBuSchnittstelle --> 0
|
||||
@@ -147,8 +147,8 @@
|
||||
'path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir
|
||||
'pathArchiv = ""
|
||||
End If
|
||||
If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If Not System.IO.Directory.Exists(path) Then System.IO.Directory.CreateDirectory(path)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -187,14 +187,14 @@
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchiv <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If path <> pathArchiv Then IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
If path <> pathArchiv Then System.IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(path & Dateiname)
|
||||
Else
|
||||
IO.File.Delete(path & Dateiname)
|
||||
System.IO.File.Delete(path & Dateiname)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -173,14 +173,14 @@
|
||||
' pathType: TRANSIT
|
||||
Try
|
||||
getDefaultFolder_SEND = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir(False) & "MIC\" & If(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TESTSYSTEM", "ECHTSYSTEM") & "\Ausgang_Zolldaten\" & pathType & "\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\" ' Path.GetTempPath
|
||||
If Not IO.Directory.Exists(getDefaultFolder_SEND) Then
|
||||
IO.Directory.CreateDirectory(getDefaultFolder_SEND)
|
||||
If Not System.IO.Directory.Exists(getDefaultFolder_SEND) Then
|
||||
System.IO.Directory.CreateDirectory(getDefaultFolder_SEND)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Try
|
||||
getDefaultFolder_SEND = "C:\TEMP\" ' Path.GetTempPath
|
||||
If Not IO.Directory.Exists(getDefaultFolder_SEND) Then
|
||||
IO.Directory.CreateDirectory(getDefaultFolder_SEND)
|
||||
If Not System.IO.Directory.Exists(getDefaultFolder_SEND) Then
|
||||
System.IO.Directory.CreateDirectory(getDefaultFolder_SEND)
|
||||
End If
|
||||
Catch ex2 As Exception
|
||||
MsgBox(ex2.Message & ex2.StackTrace)
|
||||
@@ -199,7 +199,7 @@
|
||||
' Return False
|
||||
' End If
|
||||
|
||||
' If Not IO.File.Exists(file) Then Return False
|
||||
' If Not System.IO.File.Exists(file) Then Return False
|
||||
' Dim F As New System.IO.FileInfo(file)
|
||||
|
||||
' Dim DY_server = ""
|
||||
|
||||
@@ -74,14 +74,14 @@
|
||||
pathArchiv = ""
|
||||
End If
|
||||
|
||||
If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
If Not System.IO.Directory.Exists(path) Then System.IO.Directory.CreateDirectory(path)
|
||||
|
||||
|
||||
'Zuerst alle IMP-Daten löschen, damit es zu keinen Missverständnissen kommt
|
||||
'For Each f In IO.Directory.GetFiles(path)
|
||||
'For Each f In System.IO.Directory.GetFiles(path)
|
||||
' If f.ToString.Contains("DVO_IMP_") Then
|
||||
' Try
|
||||
' IO.File.Delete(f)
|
||||
' System.IO.File.Delete(f)
|
||||
' Catch ex As Exception
|
||||
' End Try
|
||||
' End If
|
||||
@@ -145,14 +145,14 @@
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchiv <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
System.IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(path & Dateiname)
|
||||
Else
|
||||
IO.File.Delete(path & Dateiname)
|
||||
System.IO.File.Delete(path & Dateiname)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -112,8 +112,8 @@ Public Class cDatev_Interface
|
||||
pathKD = "\\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\DATEV\STAMMDATEN\ " & FIRMA.Firma_Bez & "\" & Geschaeftsjahr & "\"
|
||||
'pathArchivKD = ""
|
||||
End If
|
||||
If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If Not System.IO.Directory.Exists(pathKD) Then System.IO.Directory.CreateDirectory(pathKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -141,14 +141,14 @@ Public Class cDatev_Interface
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchivKD <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then System.IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(pathKD & DateinameKD)
|
||||
Else
|
||||
IO.File.Delete(pathKD & DateinameKD)
|
||||
System.IO.File.Delete(pathKD & DateinameKD)
|
||||
End If
|
||||
|
||||
updateFibu(filialNr) ' UPDATE FiBuSchnittstelle --> 0
|
||||
@@ -266,8 +266,8 @@ Public Class cDatev_Interface
|
||||
pathArchiv = " \\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\DATEV\ARCHIV\AR-DATEN\" & FIRMA.Firma_Bez & "\"
|
||||
path = "\\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\DATEV\AR-DATEN\" & FIRMA.Firma_Bez & "\" & Geschaeftsjahr & "\"
|
||||
End If
|
||||
If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If Not System.IO.Directory.Exists(path) Then System.IO.Directory.CreateDirectory(path)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
Dim NameZusatz = ""
|
||||
@@ -306,14 +306,14 @@ Public Class cDatev_Interface
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchiv <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If path <> pathArchiv Then IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.io.Directory.CreateDirectory(pathArchiv)
|
||||
If path <> pathArchiv Then System.IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(path & Dateiname)
|
||||
Else
|
||||
IO.File.Delete(path & Dateiname)
|
||||
System.IO.File.Delete(path & Dateiname)
|
||||
End If
|
||||
filepath = path & Dateiname
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -17,51 +17,51 @@ Public Class cLDV_Interface
|
||||
|
||||
Dim cnt = 0
|
||||
Try
|
||||
For Each f In IO.Directory.GetFiles(LDV_PFAD)
|
||||
For Each f In System.IO.Directory.GetFiles(LDV_PFAD)
|
||||
Dateiname = f
|
||||
Dim FI As New FileInfo(f)
|
||||
If Not FI.Name.StartsWith(".") Then
|
||||
If FI.Name.StartsWith("KD") Then 'STAMMDATEN
|
||||
'**** --> UNISPED möchte die KD Daten nicht bekommen.
|
||||
If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not System.IO.Directory.Exists(pathKD) Then System.IO.Directory.CreateDirectory(pathKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathKD)
|
||||
'Temp. DownloadPfad
|
||||
Dim destFilenameTMP = pathKD + "." & If(IO.File.Exists(pathKD & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilenameTMP = pathKD + "." & If(System.IO.File.Exists(pathKD & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
'**** Dim destFilenameTMP_archiv = pathArchivKD + "." & If(IO.File.Exists(pathArchivKD & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
|
||||
'Datei herunterladen
|
||||
IO.File.Copy(f, destFilenameTMP)
|
||||
System.IO.File.Copy(f, destFilenameTMP)
|
||||
'**** IO.File.Copy(f, destFilenameTMP_archiv)
|
||||
If IO.File.Exists(destFilenameTMP) Then IO.File.Delete(f) 'Datei nach erfolgreichem Herunterladen vom Server löschen
|
||||
If System.IO.File.Exists(destFilenameTMP) Then System.IO.File.Delete(f) 'Datei nach erfolgreichem Herunterladen vom Server löschen
|
||||
|
||||
'Gültiger Filename (Punkt entfernen)
|
||||
Dim destFilename = pathKD & If(IO.File.Exists(pathKD & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilename = pathKD & If(System.IO.File.Exists(pathKD & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
'**** Dim destFilename_archiv = pathArchivKD & If(IO.File.Exists(pathKD & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
IO.File.Move(destFilenameTMP, destFilename) 'Datei umbenennen
|
||||
'**** IO.File.Move(destFilenameTMP_archiv, destFilename_archiv) 'Datei umbenennen
|
||||
System.IO.File.Move(destFilenameTMP, destFilename) 'Datei umbenennen
|
||||
'**** System.IO.File.Move(destFilenameTMP_archiv, destFilename_archiv) 'Datei umbenennen
|
||||
|
||||
cnt += 1
|
||||
|
||||
|
||||
Else ' BUCHUNGSDATEN
|
||||
|
||||
If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If Not System.IO.Directory.Exists(path) Then System.IO.Directory.CreateDirectory(path)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
|
||||
'Temp. DownloadPfad
|
||||
Dim destFilenameTMP = path + "." & If(IO.File.Exists(path & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilenameTMP_archiv = pathArchiv + "." & If(IO.File.Exists(pathArchiv & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilenameTMP = path + "." & If(System.IO.File.Exists(path & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilenameTMP_archiv = pathArchiv + "." & If(System.IO.File.Exists(pathArchiv & "." & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
|
||||
'Datei herunterladen
|
||||
IO.File.Copy(f, destFilenameTMP)
|
||||
IO.File.Copy(f, destFilenameTMP_archiv)
|
||||
If IO.File.Exists(destFilenameTMP) Then IO.File.Delete(f) 'Datei nach erfolgreichem Herunterladen vom Server löschen
|
||||
System.IO.File.Copy(f, destFilenameTMP)
|
||||
System.IO.File.Copy(f, destFilenameTMP_archiv)
|
||||
If System.IO.File.Exists(destFilenameTMP) Then System.IO.File.Delete(f) 'Datei nach erfolgreichem Herunterladen vom Server löschen
|
||||
|
||||
'Gültiger Filename (Punkt entfernen)
|
||||
Dim destFilename = path & If(IO.File.Exists(path & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilename_archiv = pathArchiv & If(IO.File.Exists(path & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
IO.File.Move(destFilenameTMP, destFilename) 'Datei umbenennen
|
||||
IO.File.Move(destFilenameTMP_archiv, destFilename_archiv) 'Datei umbenennen
|
||||
Dim destFilename = path & If(System.IO.File.Exists(path & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
Dim destFilename_archiv = pathArchiv & If(System.IO.File.Exists(path & FI.Name), Now.ToString("yyMMdd_HHmmss.fff_"), "") & FI.Name
|
||||
System.IO.File.Move(destFilenameTMP, destFilename) 'Datei umbenennen
|
||||
System.IO.File.Move(destFilenameTMP_archiv, destFilename_archiv) 'Datei umbenennen
|
||||
|
||||
' Dim fi_dest As FileInfo = New FileInfo(destFilename)
|
||||
' ListBox3.Items.Add(frmStartOptions.cut_file(fi_dest.Name)) 'zur Liste hinzufügen
|
||||
|
||||
@@ -138,8 +138,8 @@ Public Class cSyska_Interface
|
||||
'path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir
|
||||
'pathArchivKD = ""
|
||||
End If
|
||||
If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If Not System.IO.Directory.Exists(pathKD) Then System.IO.Directory.CreateDirectory(pathKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -168,14 +168,14 @@ Public Class cSyska_Interface
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchivKD <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then System.IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(pathKD & DateinameKD)
|
||||
Else
|
||||
IO.File.Delete(pathKD & DateinameKD)
|
||||
System.IO.File.Delete(pathKD & DateinameKD)
|
||||
End If
|
||||
|
||||
'NOCH NICHT!!!
|
||||
@@ -205,8 +205,8 @@ Public Class cSyska_Interface
|
||||
' Dim pathArchivKD = "\\datenarchiv\Datenarchiv\DATENARCHIV_TESTSYSTEM\SYSKA\" & FIRMA.Firma_ID & "\" & Now.Year & "\" & Now.Date.ToShortDateString & "\Archiv\"
|
||||
' Dim pathKD = "\\datenarchiv\Datenarchiv\DATENARCHIV_TESTSYSTEM\SYSKA\" & FIRMA.Firma_ID & "\" & Now.Year & "\" & Now.Date.ToShortDateString & "\"
|
||||
|
||||
' If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
' If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
' If Not System.IO.Directory.Exists(pathKD) Then System.IO.Directory.CreateDirectory(pathKD)
|
||||
' If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
' '-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -235,14 +235,14 @@ Public Class cSyska_Interface
|
||||
|
||||
' 'In Archiv sichern
|
||||
' If pathArchivKD <> "" Then
|
||||
' If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
' If pathKD <> pathArchivKD Then IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
' If Not System.IO.Directory.Exists(pathArchivKD) Then System.IO.Directory.CreateDirectory(pathArchivKD)
|
||||
' If pathKD <> pathArchivKD Then System.IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
' End If
|
||||
|
||||
' If bool_DatenVorhanden Then
|
||||
' If OpenFile Then Process.Start(pathKD & DateinameKD)
|
||||
' Else
|
||||
' IO.File.Delete(pathKD & DateinameKD)
|
||||
' System.IO.File.Delete(pathKD & DateinameKD)
|
||||
' End If
|
||||
|
||||
' 'NOCH NICHT!!!
|
||||
@@ -305,8 +305,8 @@ Public Class cSyska_Interface
|
||||
'pathArchivKD = ""
|
||||
End If
|
||||
|
||||
If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If Not System.IO.Directory.Exists(path) Then System.IO.Directory.CreateDirectory(path)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -384,14 +384,14 @@ Public Class cSyska_Interface
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchiv <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
If path <> pathArchiv Then IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
If path <> pathArchiv Then System.IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(path & Dateiname)
|
||||
Else
|
||||
IO.File.Delete(path & Dateiname)
|
||||
System.IO.File.Delete(path & Dateiname)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -423,8 +423,8 @@ Public Class cSyska_Interface
|
||||
' Dim path = "\\datenarchiv\Datenarchiv\DATENARCHIV_TESTSYSTEM\SYSKA\" & FIRMA.Firma_ID & "\" & Now.Year & "\" & Now.Date.ToShortDateString & "\"
|
||||
|
||||
|
||||
' If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
' If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
' If Not System.IO.Directory.Exists(path) Then System.IO.Directory.CreateDirectory(path)
|
||||
' If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
' '-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -479,14 +479,14 @@ Public Class cSyska_Interface
|
||||
|
||||
' 'In Archiv sichern
|
||||
' If pathArchiv <> "" Then
|
||||
' If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
' If path <> pathArchiv Then IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
' If Not System.IO.Directory.Exists(pathArchiv) Then System.IO.Directory.CreateDirectory(pathArchiv)
|
||||
' If path <> pathArchiv Then System.IO.File.Copy(path & Dateiname, pathArchiv & Dateiname)
|
||||
' End If
|
||||
|
||||
' If bool_DatenVorhanden Then
|
||||
' If OpenFile Then Process.Start(path & Dateiname)
|
||||
' Else
|
||||
' IO.File.Delete(path & Dateiname)
|
||||
' System.IO.File.Delete(path & Dateiname)
|
||||
' End If
|
||||
|
||||
' Catch ex As Exception
|
||||
|
||||
@@ -205,12 +205,12 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
Dim filename As String = ""
|
||||
If optFileName <> "" Then
|
||||
filename = sPath & optFileName & endung '".xlsx"
|
||||
While IO.File.Exists(filename)
|
||||
While System.IO.File.Exists(filename)
|
||||
filename = sPath & optFileName & Now.ToString("ddMMyyyyHHmmss") & endung '".xlsx"
|
||||
End While
|
||||
Else
|
||||
filename = sPath & "tmp_" & Now.ToString("ddMMyyyyHHmmss") & endung '".xlsx"
|
||||
While IO.File.Exists(filename)
|
||||
While System.IO.File.Exists(filename)
|
||||
filename = sPath & "tmp_" & Now.ToString("ddMMyyyyHHmmss") & endung '".xlsx"
|
||||
End While
|
||||
End If
|
||||
@@ -276,12 +276,12 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
Dim filename As String = ""
|
||||
If optFileName <> "" Then
|
||||
filename = sPath & optFileName & endung '".xlsx"
|
||||
While IO.File.Exists(filename)
|
||||
While System.IO.File.Exists(filename)
|
||||
filename = sPath & optFileName & Now.ToString("ddMMyyyyHHmmss") & endung '".xlsx"
|
||||
End While
|
||||
Else
|
||||
filename = sPath & "tmp_" & Now.ToString("ddMMyyyyHHmmss") & endung '".xlsx"
|
||||
While IO.File.Exists(filename)
|
||||
While System.IO.File.Exists(filename)
|
||||
filename = sPath & "tmp_" & Now.ToString("ddMMyyyyHHmmss") & endung '".xlsx"
|
||||
End While
|
||||
End If
|
||||
@@ -550,7 +550,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
Try
|
||||
|
||||
' We have a embedded file. First lets try to get the file name out of memory
|
||||
Dim theStream As IO.Stream = CType(e.Data.GetData("FileGroupDescriptor"), IO.Stream)
|
||||
Dim theStream As System.IO.Stream = CType(e.Data.GetData("FileGroupDescriptor"), System.IO.Stream)
|
||||
Dim fileGroupDescriptor(512) As Byte
|
||||
theStream.Read(fileGroupDescriptor, 0, 512)
|
||||
Dim fileName As System.Text.StringBuilder = New System.Text.StringBuilder("")
|
||||
@@ -563,7 +563,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
|
||||
theStream.Close()
|
||||
' We should have the file name or if its an email, the subject line. Create our temp file based on the temp path and this info
|
||||
Dim myTempFile As String = IO.Path.GetTempPath & VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(fileName.ToString)
|
||||
Dim myTempFile As String = System.IO.Path.GetTempPath & VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(fileName.ToString)
|
||||
|
||||
' Look to see if this is a email message. If so save that temporarily and get the temp file.
|
||||
If InStr(myTempFile, ".msg") > 0 Then
|
||||
@@ -580,19 +580,19 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
objMI = Nothing
|
||||
Else
|
||||
' If its a attachment we need to pull the file itself out of memory
|
||||
Dim ms As IO.MemoryStream = CType(e.Data.GetData("FileContents", True), IO.MemoryStream)
|
||||
Dim ms As System.IO.MemoryStream = CType(e.Data.GetData("FileContents", True), System.IO.MemoryStream)
|
||||
Dim FileBytes(CInt(ms.Length)) As Byte
|
||||
' read the raw data into our variable
|
||||
ms.Position = 0
|
||||
ms.Read(FileBytes, 0, CInt(ms.Length))
|
||||
ms.Close()
|
||||
' save the raw data into our temp file
|
||||
Dim fs As IO.FileStream = New IO.FileStream(myTempFile, IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
|
||||
Dim fs As System.IO.FileStream = New System.IO.FileStream(myTempFile, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write)
|
||||
fs.Write(FileBytes, 0, FileBytes.Length)
|
||||
fs.Close()
|
||||
End If
|
||||
' Make sure we have a actual file and also if we do make sure we erase it when done
|
||||
If IO.File.Exists(myTempFile) Then
|
||||
If System.IO.File.Exists(myTempFile) Then
|
||||
' Assign the file name to the add dialog
|
||||
EmAilAttach = myTempFile
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user