WaitForFile

Methode (Function) · gibt Boolean zurück

WaitForFile ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.

Beschreibung (Originaltext der englischen SDK-Dokumentation): Waits until a file exists, can be opened for reading and is not locked by another process. Checks every 100 ms.

Rückgabe: True as soon as the file is accessible; False if the time ran out.

Deklaration

Public Function WaitForFile(ByVal filePath As String, ByVal waitTimeInMilliseconds As Integer) As Boolean

Parameter

NameTypPflichtBeschreibung
filePathStringerforderlichPath of the file
waitTimeInMillisecondsIntegererforderlichMaximum waiting time in milliseconds

Aufruf (VB.NET)

Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
Dim filePath As String = ""
Dim waitTimeInMilliseconds As Integer = 0
If Not alo.WaitForFile(filePath, waitTimeInMilliseconds) Then
    Console.WriteLine("Fehler: " & alo.Last_Error)
End If

Aufruf (C#)

var zfStandard = Aloaha_ZUGFeRD.iXML.ZUGFeRDVersion.xInvoice;   // Optional ByRef im Konstruktor: in C# mit ref übergeben
var alo = new Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, false, "IHR-LIZENZSCHLUESSEL", ref zfStandard);
string filePath = "";
int waitTimeInMilliseconds = 0;
if (!alo.WaitForFile(filePath, waitTimeInMilliseconds))
{
    Console.WriteLine("Fehler: " + alo.Last_Error);
}

Quelle: XML-Dokumentationskommentare des Aloaha ZUGFeRD SDK (xml.vb). Gleiche Signatur in VB6/VBA über COM. In C# werden ByRef-Parameter mit ref übergeben, VB-Eigenschaften mit Parametern heißen get_…/set_…, optionale Parameter können entfallen.