473,396 Members | 1,785 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,396 software developers and data experts.

File Access Denied!

Hi ,
Platform VB.Net
I have a form with a listview(filled with all the ".bmp" files on "c:\") and
a picture box.
The picturebox displays the image files which are in selected mode on the
listview .
My problem is, i get the "security_exception" error,when i try to delete the
selected files in the listview.
I use the "filesystemobject" to delete the file(s).
I try to dispose the images displayed by the picturebox but still the same
error is thrown.
I'm sure that all of the image files are in "normal mode", not "readonly".

Any suggestions!
Thanks.
Tarkan

Jul 19 '05 #1
1 9173
Hi tarkan,
To delete files, use the following:

IO.File.Delete(fname)

Where fname is the full path of the file to delete, for instance
"c:\test\file.bmp".
If you still get Access Denied, then it's because of system level security
permissions!
Try to delete the same file with Windows Explorer. If you cant with Windows
Explorer, that's because you are not logged as administrator or have no
rights to do it.
That is obvious! If an user runs your application on a Windows XP limited
account the application privileges are the same as user's. That means he
will not be able to delete some folders and files. That is normal and "by
design". What your application should do is to catch the exceptions and
handle it in an user-friendly way (message box, button disable, or
whatever).

Regards,
Mario
"tarkan" <mt*****@msn.com'@nospam> wrote in message
news:eM**************@TK2MSFTNGP09.phx.gbl...
Hi ,
Platform VB.Net
I have a form with a listview(filled with all the ".bmp" files on "c:\") and a picture box.
The picturebox displays the image files which are in selected mode on the
listview .
My problem is, i get the "security_exception" error,when i try to delete the selected files in the listview.
I use the "filesystemobject" to delete the file(s).
I try to dispose the images displayed by the picturebox but still the same
error is thrown.
I'm sure that all of the image files are in "normal mode", not "readonly".

Any suggestions!
Thanks.
Tarkan

Jul 19 '05 #2

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

Similar topics

0
by: Bill Burwell | last post by:
I am converting a VB6 WebClass application to VB.Net. Used the VB upgrade tool to do the conversion - and it left me a lot of little code things to do. Did those code things and got my app to...
1
by: Edward Yang | last post by:
I setup web.config with impersonation="true". On our local server the project works great. I did the same procedures on our staging server, but it failed with an impossible error: Server Error in...
4
by: Thomas Scheiderich | last post by:
The following code works fine. It opens file reads the data and then closes. **************************************************************************** **************** Dim objFileInfo As...
3
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
1
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently...
5
by: Joe | last post by:
I'm getting the following error when trying to call a page on a secure server. I'm not doing any impersonations or file access of any kind. The page is using PayPal and I'm wondering if PayPal has...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
0
by: Elroyskimms | last post by:
I need to execute a batch file via ASP.Net. In my VB.Net code, I'm using System.Diagnostics.Process to call the batch file and its appropriate command line arguments. I'm using...
1
by: igotyourdotnet | last post by:
Ok, here is the issue: I have 2 web pages one does a file upload to a database and the other page does a FTP to a server, both pages use the c:\temp directory. The page that uploads to a database...
0
by: Andy | last post by:
Thanks Peter, I thought I'd give an update on this problem. My application had 2 assemblies that contained classed for the Data access and business logic layer. It was on one of them that I was...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.