ich nur in das gleiche Problem lief, außer ich Foxit statt Acrobat. Ich habe Foxit gesagt, dass er nicht im Browser laufen soll, dann hat dieser Code gut funktioniert. Hier ist eine komplette Einheit Test, der den Trick tun sollten:
string file = Path.Combine(Directory.GetCurrentDirectory(), "test.pdf");
using (IE ie = new IE())
{
FileDownloadHandler handler = new FileDownloadHandler(file);
using (new UseDialogOnce(ie.DialogWatcher, handler))
{
try
{
ie.GoToNoWait("http://www.tug.org/texshowcase/cheat.pdf");
//WatiN seems to hang when IE loads a PDF, so let it timeout...
ie.WaitForComplete(5);
}
catch (Exception)
{
//Ok.
}
handler.WaitUntilFileDownloadDialogIsHandled(30);
handler.WaitUntilDownloadCompleted(30);
}
}
Assert.That(File.Exists(file));