Compare deux chemins pour déterminer si ils partagent un préfixe commun
#include <WinAPIShPath.au3>
_WinAPI_PathCommonPrefix ( $sPath1, $sPath2 )
$sPath1 | Le premier nom de chemin. |
$sPath2 | Le deuxième nom de chemin. |
Retourne le préfixe commun, @extended contiendra le nombre de caractères communs du préfixe dans le chemin.
Consultez PathCommonPrefix dans la librairie MSDN.
#include <WinAPIShPath.au3> Local $sPath1 = 'C:\Documents\Test.txt' Local $sPath2 = 'C:\Documents\Archive\Sample.txt' ConsoleWrite('Path1 : ' & $sPath1 & @CRLF) ConsoleWrite('Path2 : ' & $sPath2 & @CRLF) ConsoleWrite('Prefix: ' & _WinAPI_PathCommonPrefix($sPath1, $sPath2) & @CRLF)