MS windream

This commit is contained in:
SchreiberM 2020-04-06 13:20:15 +02:00
parent a8a9dd84eb
commit dc82b42e7a
2 changed files with 24 additions and 2 deletions

View File

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

View File

@ -101,6 +101,8 @@ Public Class Windream
End Get
End Property
#End Region
''' <summary>
''' Creates a new Windream object and connects to a server with the provided options and credentials
@ -731,7 +733,7 @@ Public Class Windream
If UsesDriveLetter Then
' Remove Driveletter eg. W:\
If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then
oNormalizedPath = oNormalizedPath.Substring(ClientDriveLetter + 2)
oNormalizedPath = oNormalizedPath.Substring(ClientDriveLetter.Length + 2)
End If
Else
If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then
@ -1104,6 +1106,7 @@ Public Class Windream
Return True
Catch ex As Exception
_logger.Error(ex)
UnlockObject(oWMObject)
Return False
End Try
End Function
@ -1343,6 +1346,25 @@ Public Class Windream
Return False
End Try
End Function
Public Function VersionWMFilename(pPath As String, pExt As String)
Dim rNewFilepath As String = pPath
pPath = GetNormalizedPath(pPath)
Dim oPath = pPath.Substring(0, pPath.LastIndexOf("\"))
Dim oFilename = pPath.Substring(pPath.LastIndexOf("\") + 1, pPath.Length - pPath.LastIndexOf("\") - 1)
Dim oCheck = oFilename
Dim oSplit As List(Of String) = oFilename.Split("~").ToList()
oFilename = oFilename.Replace(pExt, "")
Dim oCount As Integer = 2
Do While TestFileExists(rNewFilepath) = True
oFilename = oFilename.Replace(pExt, "")
Dim oVersion = "~" + (oCount - 1).ToString
oFilename = oFilename.Replace(oVersion, "")
oFilename = oFilename & "~" & oCount & pExt
oCount += 1
rNewFilepath = oPath + "\" + oFilename
Loop
Return rNewFilepath
End Function
Public Function TestFolderExists(Path As String) As Boolean
Return TestObjectExists(GetNormalizedPath(Path), WMEntityFolder)
End Function