Solved

File manipulation by a web service in vb.net  --- no DoEvents, so what now?

Posted on 2011-09-28
2
323 Views
Last Modified: 2012-05-12
If System.IO.File.Exists(str_save_file_with_jpg_name) And pgno = 1 Then

                System.IO.File.Delete(str_save_file_with_jpg_name)


                actfile.Save(str_save_file_with_jpg_name, System.Drawing.Imaging.ImageFormat.Tiff)

            End If

Open in new window


Haven't had a chance to test this yet, but I have a bad feeling about it.

I am pretty sure that if the file has to be deleted, the file save is going to fail because
the file I am supposed to be creating will already be in use to be deleted...I will probably run into a permissions problem because there is no delay between the deletion of the file and the
re-creation of the same file.

There is no DoEvents for a web service, so what is the proper way to handle this?

Thanks in advance!
0
Comment
Question by:codefinger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 36768156
You might be able to use a Thread.Sleep(milliSeconds) to slow down the process...
0
 

Author Closing Comment

by:codefinger
ID: 36817749
Did not actually encounter the problem after all, but this is a good solution if I do.
Thanks!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Fluent Interface Design Pattern You can use the Fluent Interface (http://en.wikipedia.org/wiki/Fluent_interface) design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
Introduction Many of the most common information processing tasks require sorting data sets.  For example, you may want to find the largest or smallest value in a collection.  Or you may want to order the data set in numeric or alphabetical order. …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question