System.IO, Zugferd

This commit is contained in:
2024-09-23 09:53:59 +02:00
parent 9337d563e5
commit 0db7067b42
14 changed files with 152 additions and 152 deletions

View File

@@ -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

View File

@@ -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 = ""

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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