473,404 Members | 2,137 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,404 software developers and data experts.

can't delete file

I need a form to delete an image that is shown in a control, to replace with
another image.
I tried changing the archive that is showing the control, closing the form
and then deleting the old image, but there's an error
because the system says that the archive is in use.
I need to replace this image, someone knows a way to close conections to the
archive, or something like this?
Thanks

Nov 21 '05 #1
2 1434
"Penk" <el*****@hotmail.com> schrieb:
I need a form to delete an image that is shown in a control, to replace
with
another image.
I tried changing the archive that is showing the control, closing the form
and then deleting the old image, but there's an error
because the system says that the archive is in use.
I need to replace this image, someone knows a way to close conections to
the
archive, or something like this?


\\\
Dim OriginalImage As New Bitmap("C:\WINDOWS\Angler.bmp")
Dim Image As New Bitmap(OriginalImage)
OriginalImage.Dispose()
..
..
..
Image.Dispose()
///

- or -

\\\
Dim ImageFile As New FileStream("C:\WINDOWS\Angler.bmp", FileMode.Open)
Dim Reader As New BinaryReader(ImageFile)
Dim ImageStream As New
MemoryStream(Reader.ReadBytes(CInt(ImageFile.Lengt h)))
Reader.Close()
Dim Image As Image = Image.FromStream(ImageStream)
..
..
..
Image.Dispose()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
"Penk" <el*****@hotmail.com> schrieb:
I need a form to delete an image that is shown in a control, to replace
with
another image.
I tried changing the archive that is showing the control, closing the form
and then deleting the old image, but there's an error
because the system says that the archive is in use.
I need to replace this image, someone knows a way to close conections to
the
archive, or something like this?


\\\
Dim OriginalImage As New Bitmap("C:\WINDOWS\Angler.bmp")
Dim Image As New Bitmap(OriginalImage)
OriginalImage.Dispose()
..
..
..
Image.Dispose()
///

- or -

\\\
Dim ImageFile As New FileStream("C:\WINDOWS\Angler.bmp", FileMode.Open)
Dim Reader As New BinaryReader(ImageFile)
Dim ImageStream As New
MemoryStream(Reader.ReadBytes(CInt(ImageFile.Lengt h)))
Reader.Close()
Dim Image As Image = Image.FromStream(ImageStream)
..
..
..
Image.Dispose()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

3
by: lawrence | last post by:
I've two scripts, one to upload images, another to delete them. The upload script works fine, but the delete script has permissions trouble. How can PHP not have permission to delete an image it...
18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
0
by: Phil... | last post by:
I have a directory with a lot of jpg files. I want to delete the small ones. Small means less than 100 pixels by 100 pixels. I use File.list() to get the list of files. I use ImageIcon(filename)...
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....
5
by: | last post by:
Hi all, I've been using C++ for quite a while now and I've come to the point where I need to overload new and delete inorder to track memory and probably some profiling stuff too. I know that...
12
by: Lucas Tam | last post by:
I have a very simple loop: If (Directory.Exists(tempDirectory)) Then Try Dim Files() As String = Directory.GetFiles(tempDirectory) 'Clear out directory For Each Filename As String In Files...
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
2
by: createdbyx | last post by:
I am trying to make a file sync utillity to sync files between my laptop and my desktop pc. On my desktop machine (xp pro sp2) I have shared my "Visual Studio Projects" folder using windows simple...
2
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include...
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: 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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.