I'm using a webbrowsercontrol to show .pdf's stored locally. At button press I want the webbrowser to show an empty page/nothing and I want to move the .pdf to a different folder. First I tried navigating to "" before moving but my .pdf was used by another process. Google told me that I probably needed to clear the browser's cache to be able to move it. I did so using the code found here: http://www.gutgames.com/post/Clearing-the-Cache-of-a-WebBrowser-Control.aspx and I even tried the alternative code line found in comment nr 2, but none of these let me move my .pdf, it's still used by another process.
What can/should I do to be able to move the file? Have I forgotten something?
At the second File.Move is where I get the error:
webBrowser1.Navigate("");
WebBrowserHelper.ClearCache();
if (calConv != "")
{
File.Move(forsDir + calConv + ".cal", forsDir + calConv.Replace("ToDo\\", "") + ".cg4");
File.Move(forsDir + calConv + ".pdf", forsDir + calConv.Replace("ToDo\\", "") + ".pdf");
}