How to load local * .htm file in WPF WebBroswer with relative path

Possible duplicate:
Upload a local HTML file to C # WebBrowser

I am creating a program in C # (VS 2010) and I want to show the help file. I created a help.htm file. This file is included in the solution in the reference directory. And I need this htm file download for webBroswer in the dialog. But there is a problem when I try to use a relative path.

            HelpWindow helpwin = new HelpWindow(); //creating new window

            Uri helpUri = new Uri ("help\\pm_view.htm",UriKind.RelativeOrAbsolute); //setting path

            helpwin.webBrowser.Navigate(helpUri); //navigating webBroswer

After that, I get an error: relative URIs are not allowed. Parameter Name: Source

There is my C # solution scheme in the picture:

enter image description here

Please, help?!

Thank you so much!

+3
source share
2 answers

Have you tried using

Path.GetFullPath (YourRelativePath)

: WPF?

+2

All Articles