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

How to replace or delete the image that has been used by another process previously u

Hi,
I'm using web cam to save,update the image in base directory folder.I can save the image but, while attempting to update the image..I caught an error!!

C#.Net:
The process cannot access the file 'C:\..~..\bin\Debug\customer_photos\10.jpg' because it is being used by another process.

..?
Thanks in advance..
Apr 6 '12 #1
2 2453
Stewart Ross
2,545 Expert Mod 2GB
You have not posted the code concerned, but the error message is indicating that whatever process you are using to save the file the process has not been cleanly completed. You may still have an object or other variable linked to that file which is still in scope resulting in Windows being unable to release the 'in-use' lock placed on the file during the copy. Can't really say any more without seeing the code.

-Stewart
Apr 6 '12 #2
RhysW
70
I faced this problem a lot when I was trying to create and then overwrite the contents of a text file, I had forgotten to do tw.close(); when I created it initially so the text-writer was permanently linked to the file holding it open, so step one would be sure you closed off the creators, even if it isn't the problem its good practice and saves on resources! but as posted above some code would be useful for a better diagnosis
Apr 13 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: foo | last post by:
I'm creating a debug class called debug_mem_allocation for the purpose of finding memory leaks. I used macro's to replace the new and delete operators. My problem is with trying to replace the...
0
by: Balakrsihna | last post by:
Hi All, Can anyone tell me how to replace an image in MS Word 2003 using c#.net. I am converting an html file to word doc and sending this as attachment using System.Web.Mail; the...
1
by: Ponnurangam | last post by:
Hi, I have a Web page that displays an image. The image has three buttons at the bottom. I have to delete the image on clicking of one of the button. But when I try to delete the image in...
3
by: guoqi zheng | last post by:
Dear sir, There is an import tool on my web application, user can upload Ms Access file, the file is saved at a temp folder on the server. After the import is finished, for security reason, I...
0
by: Silvia | last post by:
Hi, I have a program that capture images and put this into a listview (using imagelist), the problem is when I delete de image the listview, when do that and capture another image, the image...
13
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it...
0
by: ary | last post by:
hi all I have a problem with working file when i upload a file in IIS I can'd Delete it. if I try to delete it in debug mode , it successfully worked. my error message "the process...
1
by: manojpolawar2008 | last post by:
Hi , i am using asp.net2.0 in that DirectoryInfo object for reading the files. i have added each file record to DataTable object. and bind that to gridview and added one templete...
5
krungkrung
by: krungkrung | last post by:
hi again to everyone! I made a simple program(for my VB.Net practice). The program loads an image file to a picturebox upon clicking a button. after loading the image file i have another button to...
1
by: eran otzar | last post by:
I've got a problem wich cant manage to overcome although it might seem fairly simple. I've got a chat program, in wich i want to enable users to change user pics at runtime. There's a picture box...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.