Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can a VFP application have Write rights?
Message
 
À
26/04/2005 13:02:31
Joel Hokanson
Services Integration Group
Bellaire, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01008493
Message ID:
01008572
Vues:
20
>If my application does log on as another user, can it just copy the file and then immediatly revert back to the original user?

Joel,

Yes, it does. I had a similar task: providing regular read-write access to a folder with DBF files from within a VFP application, while preventing users to access this folder in Explorer.

I used API calls LogonUser, ImpersonateLoggedOnUser and RevertToSelf. The last call is actually answers your question.

It took time to make it work though. Possible issues:

- you need to reconnect to required network resources (network drives, printers) for the temporary user

- make sure that the path to temporary FoxPro files is valid for impersonated user -- important when you run SQL statements, reindex tables and so on under temporary user's credentials.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform