MS Browser relative addressing

C

Chuck Bowling

I have a form with a browser control on it that i want to display a page in
the application directory of a Forms project. I _think_ the browser is
looking for an absolute address but an absolute address would make the app
nonportable. Anybody know how I can feed the browser control a relative
address that isn't dependant on the full path?


public class FoodHelpBrowser : System.Windows.Forms.Form
{
private AxSHDocVw.AxWebBrowser axWebBrowser1;
private System.ComponentModel.Container components = null;

public FoodHelpBrowser()
{
InitializeComponent();

Object o = null;
axWebBrowser1.Navigate("FoodHelp.html", ref o, ref o, ref o, ref o);
this.Show();
}
}
 
S

Sherif ElMetainy

Hello

You can use
Application.StartupPath + Path.DirectrorySeparatorChar + "FoodHelp.html"

This make you pass the full path of the file, without hardcoding the path.
Best regards
Sherif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top