471,350 Members | 1,265 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

webbrowser control locks a file cannot delete

Hi

I have a windows form application and am using WebBrowser control to display
a PDF document. The problem is that it will display the PDF file just fine
however, when i try to delete the file it complains of Sharing violation as
file is locked by Web Browser control.

How do I release the file?

Please help!

-Sam
Feb 2 '06 #1
1 6612
Sam,

I would say that it is not the web browser specifically that is locking
it, but rather, the adobe acrobat reader that is doing it.

Needless to say, it doesn't really matter, since the file is locked.

You could monitor when the page navigates away from the PDF, and then
try to delete it. You should be able to delete it then.

Either that, or keep a list of documents that you are viewing locally
that need to be deleted, and delete them when the app shuts down.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sameer" <sb****@netflix.com> wrote in message
news:uC*************@TK2MSFTNGP09.phx.gbl...
Hi

I have a windows form application and am using WebBrowser control to
display a PDF document. The problem is that it will display the PDF file
just fine however, when i try to delete the file it complains of Sharing
violation as file is locked by Web Browser control.

How do I release the file?

Please help!

-Sam

Feb 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Anil Gupte | last post: by
2 posts views Thread by David Veeneman | last post: by
1 post views Thread by Sin Jeong-hun | last post: by
6 posts views Thread by titan.nyquist | last post: by
3 posts views Thread by =?Utf-8?B?R2F1cmF2?= | last post: by

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.