Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-28
2
Medium Priority
?
336 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 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Software development teams often use in-memory caches to improve performance. They want to speed up access to, or reduce load on, a backing store (database, file system, etc.) by keeping some or all of the data in memory.   You should implement a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

722 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