使用简单的html片段(另存为test.html)很容易重现此问题:
<style>
a { behavior: url(#default#AnchorClick); }
</style>
<a href="https://webdav.mc.gmx.net/" folder="https://webdav.mc.gmx.net/" target="_blank">open</a>
如果您在InternetExplorer中打开test.html并单击打开的链接,则会弹出一个带有指定WebDAV文件夹的新Windows资源管理器。这正是我所期待的。
现在,如果我在WPF WebBrowser-Control中打开test.html,行为就不同了。它会打开一个新的Internet Explorer窗口,显示HTTP 405错误。
以下是在WPF WebBrowser中测试它的XAML和Code-Behind:
<Window x:Class="Misc.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<WebBrowser x:Name="_browser" />
using System.IO;
namespace Misc
{
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
var folder = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
var file = Path.Combine(folder, "test.html");
_browser.Navigate(file);
}
}
}
注:
答案 0 :(得分:0)
已解决:SP1中的一个修补程序修复了此问题。不知道究竟是哪一个,但这里是完整的清单: