Find html file in root folder using web control

  • Thread starter Thread starter Carl Gilbert
  • Start date Start date
C

Carl Gilbert

Hi

I have a Windows WebControl on my form and I plan to burn the application to
a CD. The applcation has to navigate to a page that I am keeping in the
root of the CD. I have put the page I want to navigate to in the bin folder
along with the exe.

I then put the following line in the load of my application:
Me.webControl.Navigate(".\summarypage.html")

This doesn't work though, it just says it can't load the page (Action
Cancelled). However if I put the full address of the file then it loads
correctly.
Something like:
Me.webControl.Navigate("C:\Documents and
Settings\carlg\Desktop\PortHost\bin\summarypage.html")

Does anyone know how I can navigate to a file in the same folder as the exe?

Note: The exe and the default page will be on the root of the CD.

Regards, Carl Gilbert
 
Does anyone know how I can navigate to a file in the same folder as

You could try this:

\\\
Dim filename As String
filename = System.Windows.Forms.Application.StartupPath & _
"\summarypage.html"
Me.webControl.Navigate(filename)
///
 
If the exe and default page on the same folder, then just use this.
Me.webControl.Navigate("summ­arypage.html")
 
Oenone said:
You could try this:

\\\
Dim filename As String
filename = System.Windows.Forms.Application.StartupPath & _
"\summarypage.html"
Me.webControl.Navigate(filename)
///


Application.StartupPath worked.

Cheers.
 

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

Back
Top