我觉得自己真的很蠢,但我无法想象这一点。
这完美无瑕;
((System.Windows.Controls.WebBrowser)e.Control).Navigate(new Uri("http://www.google.com"));
但是当我尝试导航到磁盘上的文件时,它失败了
string path =@"D:\dev\MySite.html";
((System.Windows.Controls.WebBrowser)e.Control).Navigate(new Uri(path));
我想我不能使用Uri,但我应该用什么来导航到磁盘上的文件?
完整代码;
private void webControlAvailable(object sender, ControlAvailableEventArgs e)
{
string path =@"D:\dev\MySite.html";
((System.Windows.Controls.WebBrowser)e.Control).Navigate(new Uri(path));
}
答案 0 :(得分:0)