如何在silverlight webbrowser控件中使用本地文件系统?

时间:2012-02-09 11:19:43

标签: html silverlight webbrowser-control

大家好。我正在使用Silverlight webbrowser控件,我遇到了一些问题。我正在尝试在我的silverlight项目中的webbrowser控件中使用Html页面,我想从本地文件系统加载此页面。所以我这样做:

string html = File.ReadAllText(@"C:/Users/mehdi/Desktop/essai.html");
       wbNavigator.NavigateToString(html);

执行此操作时,我遇到此异常:Unauthorized file operation. Access to the path is denied。任何人都可以帮助我PLZ? thx。

1 个答案:

答案 0 :(得分:1)

对于此类访问,有问题的Silverlight应用程序需要提升权限。没有你有两个选择:

  • 让用户浏览到您要使用的文件
  • 使用Silverlight
  • 在服务器上托管html