Fiskaltrist, fakt, Verzollungsunterlagen, etc.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.IO.Pipes
|
||||
Imports System.Net.Mail
|
||||
@@ -1120,6 +1121,106 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
|
||||
End Function
|
||||
|
||||
Shared Function checkifMailisOK_better(emailList As String) As String
|
||||
|
||||
|
||||
If String.IsNullOrWhiteSpace(emailList) Then Return ""
|
||||
|
||||
Dim invalid As New List(Of String)
|
||||
Dim idn As New IdnMapping()
|
||||
|
||||
For Each email As String In emailList.Split(";"c, ","c)
|
||||
|
||||
Dim e As String = email.Trim()
|
||||
|
||||
If e = "" Then Continue For
|
||||
|
||||
Try
|
||||
|
||||
' Genau ein @
|
||||
Dim atPos As Integer = e.LastIndexOf("@"c)
|
||||
|
||||
If atPos <= 0 OrElse atPos <> e.IndexOf("@"c) Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim localPart As String = e.Substring(0, atPos)
|
||||
Dim domainPart As String = e.Substring(atPos + 1)
|
||||
|
||||
' RFC-Grenzen
|
||||
If localPart.Length = 0 OrElse localPart.Length > 64 Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
If localPart.Any(Function(c) AscW(c) > 127) Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
If e.Length > 320 Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
' Keine führenden/abschließenden Punkte
|
||||
If localPart.StartsWith(".") OrElse localPart.EndsWith(".") Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
' Keine doppelten Punkte
|
||||
If localPart.Contains("..") Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
' Internationale Domain nach ASCII wandeln
|
||||
Dim domainAscii As String = idn.GetAscii(domainPart)
|
||||
|
||||
' Domain muss einen Punkt enthalten
|
||||
If Not domainAscii.Contains("."c) Then
|
||||
invalid.Add(e)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
' Domainlabels prüfen
|
||||
For Each label As String In domainAscii.Split("."c)
|
||||
|
||||
If label.Length = 0 OrElse label.Length > 63 Then
|
||||
invalid.Add(e)
|
||||
GoTo NextMail
|
||||
End If
|
||||
|
||||
If label.StartsWith("-") OrElse label.EndsWith("-") Then
|
||||
invalid.Add(e)
|
||||
GoTo NextMail
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
' .NET-Prüfung
|
||||
Dim normalizedEmail As String = localPart & "@" & domainAscii
|
||||
Dim addr As New MailAddress(normalizedEmail)
|
||||
|
||||
If addr.Address <> normalizedEmail Then
|
||||
invalid.Add(e)
|
||||
End If
|
||||
|
||||
Catch
|
||||
invalid.Add(e)
|
||||
End Try
|
||||
|
||||
NextMail:
|
||||
Next
|
||||
|
||||
Return String.Join(";", invalid)
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Shared Function checkLKWNr(lkwNr As String) As List(Of String)
|
||||
|
||||
Dim ListOfLKWNr As New List(Of String)
|
||||
|
||||
Reference in New Issue
Block a user