473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can't delete files on server

ad
I want to delete a file on server with the code:
File.Delete(sFileName);

But it result in a run time error:
Access to the path ... is denied.

I verify the access right of the path, I found that the "Network Service"
did not have modify right.

How can I delete a file on server?
Nov 19 '05 #1
3 1834
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:Or*************@tk2msftngp13.phx.gbl...
How can I delete a file on server?


1) Give the account that ASP.NET is running under sufficient privileges

or

2) Make ASP.NET impersonate another user account which has sufficient
privileges
Nov 19 '05 #2
ad
How to Make ASP.NET impersonate another user?
Could you give me am example?
Thank!
"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> ¼¶¼g©ó¶l¥ó·s»D:u$**************@TK2MSFTNGP10.phx.g bl...
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:Or*************@tk2msftngp13.phx.gbl...
How can I delete a file on server?


1) Give the account that ASP.NET is running under sufficient privileges

or

2) Make ASP.NET impersonate another user account which has sufficient
privileges

Nov 19 '05 #3
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OG**************@TK2MSFTNGP10.phx.gbl...
Could you give me am example?


Google is your friend...
http://www.google.com/search?sourcei...22+impersonate
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: tvr | last post by:
Hi, I have a strange problem. I am not able to delete a published folder. Any ideas?? The files in the folder are not open, but it still says that "Please make sure files ...." I am...
5
by: Raj | last post by:
Hi all, Can anyone help me with a script which would delete files or move them to a different folder at some scheduled time..! Please.....!!! Thanks in advance...
1
by: news.corp.adobe.com | last post by:
I need to perform basic authentication and I also need to be able to use the put and delete methods to copy files / delete files on a server. Here is how I successfully perform basic...
0
by: SeanR | last post by:
I have a function to copare two files. It will first copy the original file form a different server to a local temp path and then compare that version to a version that has been restored form tape....
6
by: Neo The One | last post by:
On my development machine, I often delete all folders/files under C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files. That has not caused me any trouble til now. So now we have...
2
by: Cesar Ronchese | last post by:
Hello, I'm experiencing a very weird problem. I have a ASP.Net 2005 application (VB.Net) that creates some folders to store temporary files. example: Session_Start(...)...
11
by: comp.lang.php | last post by:
Once again, I thought my class method deleteZip() would do the trick, but it never deletes any .zip* file found in a directory: /** * Delete any latent ZIP files found in this album. This...
13
by: darrel | last post by:
When I write scripts for deleting records in databases, I tend to do it in this fashion: - delete link passes ID to a delete.aspx page - delete.aspx page queries db using that ID to retrieve the...
0
by: bdog4 | last post by:
I'm a bit new to asp.net and I'm trying to do very simple delete from a grid view but everytime I click on the delete link for the row it the page reloads and of course my row is still there. What...
36
by: pearl146 | last post by:
Hi, I have some database files (.MDF, .LDF,...) on the server. When I try to delete them, the warning "Cannot delete file: There has been a sharing violation. The source or destination file may...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.