>#Define ERROR_NOT_CONNECTED 2250 >#Define ERROR_MORE_DATA 234 >#Define ERROR_BAD_DEVICE 1200 >#Define ERROR_CONNECTION_UNAVAIL 1201 >#Define ERROR_NO_NETWORK 1222 >#Define ERROR_NO_NET_OR_BAD_PATH 1203 >#Define ERROR_EXTENDED_ERROR 1208 > >#Define UNIVERSAL_NAME_INFO_LEVEL 0x00000001 >#Define REMOTE_NAME_INFO_LEVEL 0x00000002 >Declare integer WNetGetUniversalName in win32API ; > string @ lpLocalPath, ; > integer dwInfoLevel, ; > string @ lpBuffer, ; > integer @ lpBufferSize > >Declare integer GetLongPathName in win32API ; > string @ lpszShortPath, string @ lpszLongPath, integer cchBuffer > >lpLocalPath = GetFile() > >lpBufsize = 512 >Store space(512) to lpBuffer,lpszLongPath >lnResult = WNetGetUniversalName(@lpLocalPath,REMOTE_NAME_INFO_LEVEL ,@lpBuffer,@lpBufsize) >If lnResult = ERROR_MORE_DATA && Buffer was small -retry with new bufsize > lnResult = WNetGetUniversalName(@lpLocalPath,REMOTE_NAME_INFO_LEVEL ,@lpBuffer,@lpBufsize) >ENDIF >? lnResult >Do case > Case lnResult=0 > lcInfo = substr(lpBuffer,13) > Alines(arrInfo,chrtran( substr( lcInfo,1,at(chr(0),lcInfo,3) ),chr(0),chr(13))) > ? 'Full UNC path : '+arrInfo[1] > ? 'Server path : '+arrInfo[2] > ? 'File Path : '+arrInfo[3] > ? lpLocalPath > Otherwise && Assume local path > ? lnResult > lnBuf = GetLongPathName(@lpLocalPath, @lpszLongPath, lpBufsize) > ? substr(lpszLongPath,1,lnBuf) >Endcase >>Cetin