Mehdi Boukhechba
Mehdi Boukhechba

Reputation: 2581

how to use a local filesystem in silverlight webbrowser control ?

Hello everyone. I'm using Silverlight webbrowser control, and I'm having some problems with that. I'm trying to use a Html page in a webbrowser control in my silverlight project, and i want to load this page from the local filesystem. so I'm doing this:

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

When doing this I have this exception: Unauthorized file operation. Access to the path is denied. Can anyone help me plz ? thx .

Upvotes: 0

Views: 440

Answers (1)

Ben Parsons
Ben Parsons

Reputation: 1453

For this kind of access the Silverlight app in question needs elevated permissions. Failing that you have two options:

  • have the user browse to the file you want to use
  • host the html on the server with your Silverlight

Upvotes: 1

Related Questions