Wpf 从WebBrowser控件打开Windows资源管理器(WebDAV)失败
使用一个简单的html片段(另存为test.html)很容易重现此问题:Wpf 从WebBrowser控件打开Windows资源管理器(WebDAV)失败,wpf,webbrowser-control,webdav,Wpf,Webbrowser Control,Webdav,使用一个简单的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> 注: 在这两种情况下,因为它是一个本地文件,所以您需
<style>
a { behavior: url(#default#AnchorClick); }
</style>
<a href="https://webdav.mc.gmx.net/" folder="https://webdav.mc.gmx.net/" target="_blank">open</a>
注:
在这两种情况下,因为它是一个本地文件,所以您需要在顶部的黄色条中首先允许被阻止的内容。
此示例中的URL不是真实的URL,因为它只能在intranet上访问。实际URL指向SharePoint WebDAV文件夹。
已解决:SP1中的一个修补程序修复了此问题。不知道具体是哪一个,但以下是完整的列表:
<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);
}
}
}