Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/20/2017 in all areas

  1. Trong

    [SOLVED] Umlaut.. help

    ConsoleWrite(BinaryToString(StringToBinary("Zürich")) &@CRLF)
    1 point
  2. Trong

    Last folder in a Path

    Maybe : May be helpful for you: Local $sDrive, $sDir, $sFileName, $sExtension, $sDirPath, $sParentDirName, $sFileNameExt Local $sFilePath = "C:\route\luglio\40.714224,-73.961452" Local $aPathSplit = _SplitPathRef($sFilePath, $sDrive, $sDir, $sFileName, $sExtension, $sDirPath, $sParentDirName, $sFileNameExt) ConsoleWrite("+ Parent Dir Name: " & _SplitPath($sFilePath, 6) & @CRLF& @CRLF) ConsoleWrite("!Path IN : " & $sFilePath & @CRLF) ; C:\Windows\System32\etc\hosts.exe ConsoleWrite("- Driver : " & $sDrive & @CRLF) ; C: ConsoleWrite("- Dir : " & $sDir & @CRLF) ; \Windows\System32\etc\ ConsoleWrite("- FileName : " & $sFileName & @CRLF) ; hosts ConsoleWrite("- Extension : " & $sExtension & @CRLF) ; .exe ConsoleWrite("- DirPath : " & $sDirPath & @CRLF) ; C:\Windows\System32\etc\etc ConsoleWrite("- ParentDirName: " & $sParentDirName & @CRLF) ; etc ConsoleWrite("- FileNameExt : " & $sFileNameExt & @CRLF & @CRLF) ; hosts.exe ; * -----:| Func _SplitPath($sFilePath, $rType = 0) Local $sDrive, $sDir, $sFileName, $sExtension, $sDirPath, $sParentDirName, $sFileNameExt Local $aArray = StringRegExp($sFilePath, "^\h*((?:\\\\\?\\)*(\\\\[^\?\/\\]+|[A-Za-z]:)?(.*[\/\\]\h*)?((?:[^\.\/\\]|(?(?=\.[^\/\\]*\.)\.))*)?([^\/\\]*))$", 1) ;~ If @error Then ; This error should never happen. ReDim $aArray[9] $aArray[0] = $sFilePath $sDrive = $aArray[1] ;~ EndIf If StringLeft($aArray[2], 1) == "/" Then $sDir = StringRegExpReplace($aArray[2], "\h*[\/\\]+\h*", "\/") Else $sDir = StringRegExpReplace($aArray[2], "\h*[\/\\]+\h*", "\\") EndIf $aArray[2] = $sDir $sFileName = $aArray[3] $sExtension = $aArray[4] $sParentDirName = StringRegExpReplace($sFilePath, '\\[^\\]*$', '') $sParentDirName = StringRegExpReplace($sParentDirName, '.*\\', '') $aArray[5] = $sParentDirName $sFileNameExt = $sFileName & $sExtension $aArray[6] = $sFileNameExt $sDirPath = $sDrive & $sDir $aArray[7] = $sDirPath If $rType = 1 Then Return $sDrive If $rType = 2 Then Return $sDir If $rType = 3 Then Return $sFileName If $rType = 4 Then Return $sExtension If $rType = 5 Then Return $sDirPath If $rType = 6 Then Return $sParentDirName If $rType = 7 Then Return $sFileNameExt Return $aArray EndFunc ;==>_SplitPath ; * -----:| Dao Van Trong - TRONG.WIN Func _SplitPathRef($sFilePath, ByRef $sDrive, ByRef $sDir, ByRef $sFileName, ByRef $sExtension, ByRef $sDirPath, ByRef $sParentDirName, ByRef $sFileNameExt) Local $aArray = StringRegExp($sFilePath, "^\h*((?:\\\\\?\\)*(\\\\[^\?\/\\]+|[A-Za-z]:)?(.*[\/\\]\h*)?((?:[^\.\/\\]|(?(?=\.[^\/\\]*\.)\.))*)?([^\/\\]*))$", 1) ;~ If @error Then ; This error should never happen. ReDim $aArray[9] $aArray[0] = $sFilePath $sDrive = $aArray[1] ;~ EndIf If StringLeft($aArray[2], 1) == "/" Then $sDir = StringRegExpReplace($aArray[2], "\h*[\/\\]+\h*", "\/") Else $sDir = StringRegExpReplace($aArray[2], "\h*[\/\\]+\h*", "\\") EndIf $aArray[2] = $sDir $sFileName = $aArray[3] $sExtension = $aArray[4] $sParentDirName = StringRegExpReplace($sFilePath, '\\[^\\]*$', '') $sParentDirName = StringRegExpReplace($sParentDirName, '.*\\', '') $aArray[5] = $sParentDirName $sFileNameExt = $sFileName & $sExtension $aArray[6] = $sFileNameExt $sDirPath = $sDrive & $sDir $aArray[7] = $sDirPath Return $aArray EndFunc ;==>_SplitPathRef ; * -----:| Dao Van Trong - TRONG.WIN
    1 point
  3. 1 point
×
×
  • Create New...