I have the following code:
if (System.IO.File.Exists(htmlLocation))
{
vEarthBrowser.ObjectForScripting = this;
vEarthBrowser.Url = new Uri(htmlLocation);
}
else
{
throw new Exception("HTML file not found!");
}
htmlLocation is defined as:
private string htmlLocation = "VirtualEarth.html"
Supposedly the project I got this from was in working order, but I haven't changed any code. If I run this the new Uri() line give me an error, "Invalid URI: The format of the URI could not be determined."
The file is present (as indicated by passing successfully through the Exists() method in the If). What is the correct way to reference a Url on the WebBrowser control when you want it to load a HTML file in the default application directory?
Edit:
I should clarify that this is a winforms project, not a web project.