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

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