Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Location file in the network
Message
De
16/02/2004 11:42:39
 
 
À
16/02/2004 04:30:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00877551
Message ID:
00877674
Vues:
19
Hi Cetin

Thanks for answering

but my problem is that ...

I have create a dbf to hold the location of files ...and other computer linked to me. When I save a location file, the location filename pointed to
c:\ drive which can't be use on another computer.... as well as other computers trying to save their own files which i cant use the location to point to their files



>>hi all
>>
>>How to get the network address + the location of the filename ?
>>
>>Something like getfile(), getfile() return 'c:\text.txt'
>>
>>but i would like to have the network name included
>>
>>\\servername\sharefolder\text.txt
>>
>>Thanks in advance
>
>GetFile() returns the fullpath (either c:\path\filename or \\servername\sharedfolder\filename). If you mean to return UNCpAth from a mapped drive this might help :
>
>
>#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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform