Deleting a file from windows service in c#
-
Im trying to delete a file from windows service in c# file delete or fileinfo.delete and get Access to the path X is denied how can i solve this? Samele code will be greate help thanks
poqeqw wrote:
Access to the path X is denied
Sounds like a permission issue. Are you sure the permission is set right and the file is not open by another process?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Im trying to delete a file from windows service in c# file delete or fileinfo.delete and get Access to the path X is denied how can i solve this? Samele code will be greate help thanks
You might want to check the account under which the service is configured to run. Open "services.msc" and see the properties for your service on the "Log On" tab of the properties dialog. If it is "Local System account" and its a local file you're trying to delete (i.e. not a file on a network share) then you should certainly have permission. In that case it may be that the file has been locked by some other process. If it is some other user account then verify that that account has the required permission for the file.
-- gleat http://blogorama.nerdworks.in[^] --