7 Commits

Author SHA1 Message Date
Jonathan Jenne
e21dff197f ZUGFeRDService: Version 1.7.0 2021-08-09 10:42:56 +02:00
Jonathan Jenne
029da899aa SQLConfig: Version 1.0.2 2021-08-02 11:58:52 +02:00
Jonathan Jenne
68c5f4dd3e SQLCommon: Make form title configurable 2021-08-02 11:58:34 +02:00
Jonathan Jenne
62b69bc685 Language: version 1.3.2 2021-08-02 11:58:06 +02:00
Jonathan Jenne
bc4f6e42e6 Windream: Normalize paths 2021-08-02 11:57:35 +02:00
Jonathan Jenne
850cbb2973 Language: RemoveInvalidCharacters catches exceptions 2021-08-02 11:56:45 +02:00
Jonathan Jenne
8d1dddb101 SQLConfig: turn into class lib again 2021-07-30 13:26:52 +02:00
9 changed files with 62 additions and 65 deletions

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.3.1.0")> <Assembly: AssemblyVersion("1.3.2.0")>
<Assembly: AssemblyFileVersion("1.3.1.0")> <Assembly: AssemblyFileVersion("1.3.2.0")>

View File

@@ -124,26 +124,30 @@ Public Class Utils
Public Shared Function RemoveInvalidCharacters(pString As String) As String Public Shared Function RemoveInvalidCharacters(pString As String) As String
Dim oResult = pString Dim oResult = pString
' Remove all Unicode above Codepoint U+10000 Try
oResult = Regex.Replace(oResult, InvalidChars.UnicodeSurrogates, String.Empty) ' Remove all Unicode above Codepoint U+10000
oResult = Regex.Replace(oResult, InvalidChars.UnicodeSurrogates, String.Empty)
' Remove all Emojis (Version 13) ' Remove all Emojis (Version 13)
oResult = Regex.Replace(oResult, InvalidChars.Emojis, String.Empty) oResult = Regex.Replace(oResult, InvalidChars.Emojis, String.Empty)
' Remove Invalid filename characters ' Remove Invalid filename characters
oResult = Regex.Replace(oResult, InvalidChars.Filenames, String.Empty) oResult = Regex.Replace(oResult, InvalidChars.Filenames, String.Empty)
' Remove Invalid filename characters ' Remove Invalid filename characters
oResult = Regex.Replace(oResult, InvalidChars.Paths, String.Empty) oResult = Regex.Replace(oResult, InvalidChars.Paths, String.Empty)
' Remove Uneccessary characters ' Remove Uneccessary characters
oResult = Regex.Replace(oResult, "\s{2,}", " ") oResult = Regex.Replace(oResult, "\s{2,}", " ")
oResult = Regex.Replace(oResult, "\.{2,}", ".") oResult = Regex.Replace(oResult, "\.{2,}", ".")
' Remove excess space chars ' Remove excess space chars
oResult = oResult.Trim() oResult = oResult.Trim()
Return oResult Return oResult
Catch ex As Exception
Return oResult
End Try
End Function End Function
''' <summary> ''' <summary>

View File

@@ -15,50 +15,50 @@ Public Class Helpers
INDEX_TYPE_VECTOR_TIME INDEX_TYPE_VECTOR_TIME
} }
Friend Shared Function ConvertVectorType(vType As Object, value As String) Friend Shared Function ConvertVectorType(pIndexType As Integer, pValue As String)
Dim myArray Dim myArray
ReDim myArray(0) ReDim myArray(0)
Select Case vType Select Case pIndexType
Case INDEX_TYPE_HASH ' 36865 Case INDEX_TYPE_HASH ' 36865
'Umwandeln in String 'Umwandeln in String
myArray(0) = CStr(value) myArray(0) = CStr(pValue)
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_STRING '4097 Case INDEX_TYPE_VECTOR_STRING '4097
'Umwandeln in String 'Umwandeln in String
myArray(0) = CStr(value) myArray(0) = CStr(pValue)
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_INTEGER '4098 Case INDEX_TYPE_VECTOR_INTEGER '4098
'Umwandeln in Integer 'Umwandeln in Integer
myArray(0) = CInt(value.Replace(" ", "")) myArray(0) = CInt(pValue.Replace(" ", ""))
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_FLOAT '4099 Case INDEX_TYPE_VECTOR_FLOAT '4099
value = value. pValue = pValue.
Replace(" ", ""). Replace(" ", "").
Replace(".", ",") Replace(".", ",")
'Umwandeln in Double 'Umwandeln in Double
myArray(0) = CDbl(value) myArray(0) = CDbl(pValue)
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_BOOLEAN '4100 Case INDEX_TYPE_VECTOR_BOOLEAN '4100
'Umwandeln in Boolean 'Umwandeln in Boolean
myArray(0) = CBool(value) myArray(0) = CBool(pValue)
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_DATE '4101 Case INDEX_TYPE_VECTOR_DATE '4101
'Umwandeln in Date 'Umwandeln in Date
myArray(0) = CDate(value) myArray(0) = CDate(pValue)
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_INTEGER_64BIT '4107 Case INDEX_TYPE_VECTOR_INTEGER_64BIT '4107
myArray(0) = Convert.ToInt64(value) myArray(0) = Convert.ToInt64(pValue)
Return myArray Return myArray
Case INDEX_TYPE_VECTOR_DATE_TIME '4103 Case INDEX_TYPE_VECTOR_DATE_TIME '4103
'Umwandeln in Datum Uhrzeit 'Umwandeln in Datum Uhrzeit
Return value Return pValue
Case 8204 Case 8204
'Umwandeln in Integer 'Umwandeln in Integer
myArray(0) = CInt(value.Replace(" ", "")) myArray(0) = CInt(pValue.Replace(" ", ""))
Return myArray Return myArray
Case Else Case Else
'Umwandeln in String 'Umwandeln in String
myArray(0) = CStr(value) myArray(0) = CStr(pValue)
Return myArray Return myArray
End Select End Select
End Function End Function

View File

@@ -1,4 +1,8 @@
Imports WINDREAMLib Imports System.IO
Imports System.IO.Path
Imports System.Text.RegularExpressions
Imports WINDREAMLib
Imports WINDREAMLib.WMCOMEvent Imports WINDREAMLib.WMCOMEvent
Imports WINDREAMLib.WMEntity Imports WINDREAMLib.WMEntity
Imports WINDREAMLib.WMObjectEditMode Imports WINDREAMLib.WMObjectEditMode
@@ -6,10 +10,9 @@ Imports WMOBRWSLib
Imports WMOSRCHLib Imports WMOSRCHLib
Imports WMCNNCTDLLLib Imports WMCNNCTDLLLib
Imports WMOTOOLLib Imports WMOTOOLLib
Imports System.IO
Imports System.IO.Path
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports System.Text.RegularExpressions Imports DigitalData.Modules.Language
''' <module>Windream</module> ''' <module>Windream</module>
''' <version>0.0.0.2</version> ''' <version>0.0.0.2</version>
@@ -165,6 +168,12 @@ Public Class Windream
Me.SessionServername = SessionServerName Me.SessionServername = SessionServerName
Me.ClientBasePath = GetNormalizedBasePath(BasePath) Me.ClientBasePath = GetNormalizedBasePath(BasePath)
_logger.Debug("ClientBasePath: [{0}]", ClientBasePath)
_logger.Debug("ClientDriveLetter: [{0}]", ClientDriveLetter)
_logger.Debug("SessionServername: [{0}]", SessionServerName)
_logger.Debug("SessionUserName: [{0}]", SessionUserName)
_logger.Debug("SessionDomain: [{0}]", SessionDomain)
If ClientDriveLetter = String.Empty Then If ClientDriveLetter = String.Empty Then
UsesDriveLetter = False UsesDriveLetter = False
End If End If
@@ -766,7 +775,10 @@ Public Class Windream
End Function End Function
Public Function GetNormalizedPath(Path As String) As String Public Function GetNormalizedPath(Path As String) As String
Dim oNormalizedPath = GetCleanedPath(Path) 'Dim oNormalizedPath = GetCleanedPath(Path)
Dim oNormalizedPath = Language.Utils.RemoveInvalidCharacters(Path)
_logger.Debug("Normalizing Path: [{0}]", oNormalizedPath)
Try Try
' Convert any forward slashes / and double slashes \\ into backslashes \ ' Convert any forward slashes / and double slashes \\ into backslashes \
' See: https://stackoverflow.com/questions/3144492/how-do-i-get-nets-path-combine-to-convert-forward-slashes-to-backslashes ' See: https://stackoverflow.com/questions/3144492/how-do-i-get-nets-path-combine-to-convert-forward-slashes-to-backslashes

View File

@@ -11,28 +11,3 @@
Option Strict On Option Strict On
Option Explicit On Option Explicit On
Namespace My
'HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten
' oder in dieser Datei Buildfehler auftreten, wechseln Sie zum Projekt-Designer.
' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
'
Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.DigitalData.Controls.SQLConfig.frmSQLConfig
End Sub
End Class
End Namespace

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' indem Sie "*" wie unten gezeigt eingeben: ' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyVersion("1.0.2.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.2.0")>

View File

@@ -5,12 +5,13 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{65EFB268-C0E0-40C1-8981-9F70DEE5C74A}</ProjectGuid> <ProjectGuid>{65EFB268-C0E0-40C1-8981-9F70DEE5C74A}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>Library</OutputType>
<StartupObject>DigitalData.Controls.SQLConfig.My.MyApplication</StartupObject> <StartupObject>
</StartupObject>
<RootNamespace>DigitalData.Controls.SQLConfig</RootNamespace> <RootNamespace>DigitalData.Controls.SQLConfig</RootNamespace>
<AssemblyName>DigitalData.Controls.SQLConfig</AssemblyName> <AssemblyName>DigitalData.Controls.SQLConfig</AssemblyName>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType> <MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>

View File

@@ -12,6 +12,7 @@ Public Class frmSQLConfig
Private ReadOnly LogConfig As LogConfig Private ReadOnly LogConfig As LogConfig
Public Property ConnectionString As String = String.Empty Public Property ConnectionString As String = String.Empty
Public Property FormTitle As String = ""
Public Sub New() Public Sub New()
' Dieser Aufruf ist für den Designer erforderlich. ' Dieser Aufruf ist für den Designer erforderlich.
@@ -32,6 +33,10 @@ Public Class frmSQLConfig
Private Sub frmSQLConfig_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmSQLConfig_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim oConnectionString = ConnectionString Dim oConnectionString = ConnectionString
If FormTitle.Count > 0 Then
Text = $"{FormTitle} - {Text}"
End If
If Not oConnectionString = String.Empty Then If Not oConnectionString = String.Empty Then
Dim oBuilder As SqlConnectionStringBuilder Dim oBuilder As SqlConnectionStringBuilder
Try Try

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.6.0.0")> <Assembly: AssemblyVersion("1.7.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>