Machine\User cannot modify file

  • Thread starter Thread starter Johnny Hu
  • Start date Start date
J

Johnny Hu

hi,

i wrote a simple Update Application which downloads files from ftp server to
client side,
and it will delete the old files after download the new ones.

but i found the User Group on client machine doesn't have the permission to
modify files
my application throw exception and cannot update.

is there any solution to make it work?
 
Hi Johnny,

I think we may try to use the LogonUser API to impersonate an account with
more permissions to do the delete job.

Here is an article about how to call the LogonUser in VB.NET
How to validate Windows user rights in a Visual Basic .NET application
(841699)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;841699

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
thank you peter.
the article only tells "validate user", but follow the LogonUser API tip,
i figure out how to use WindowsImpContext and WindowsPrinciple with the
token to switchuser
 
Back
Top