By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Web Browser prob: won't load an html file that is definately there

P: n/a
Hi,

I'm using vb 2003 and have a browser window. Previsouly I used the
command...
"main_browser.navigate("C:\....\html files\main.html") and the browser
succesfully navigated to the designated html file.

Then I changed it so that it only read...
"main_browser.navigate("html files\main.html") where "html files" is a
sub-folder of the location of the executable file. It now won't work.
I've used an if statement to check that the file exists and the code to
navigate should only occur if the file is found. When stepping through
the code the file is definately found-in fact the file can be opened
with a streamreader and edited! But it won't open in the browser
window.

Anyone know why?

Also, this is the first time I've made an executable version of the
program (I've previously just been running it by pressing F5). When I
ran the .exe file my firewall popped up and told me that the program
was trying to connect to a DNS server! Why on earth would it do that?

Any help would be greatly appreciated,

thanks,

Steve

Mar 26 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Steve,

The browser recognises the full path as a local path and directly opens it.

The relative path does not give many clues about the url being a local
resource. The browser is looking for your resource on the network, as it
would do if you navigated to www.google.com. That's why it is using the dns
server.

A solution might be to let your code generate a full path. The following code
should do the trick:
----- begin code -----
dim objFile as new system.io.fileinfo("html files\main.html")

main_browser.navigate(objFile.fullname)
----- end code -----

Best regards,

Renze de Waal

In article <11**********************@g10g2000cwb.googlegroups .com>, "SteMc"
<go****@jasmonio.supanet.com> wrote:
Hi,

I'm using vb 2003 and have a browser window. Previsouly I used the
command...
"main_browser.navigate("C:\....\html files\main.html") and the browser
succesfully navigated to the designated html file.

Then I changed it so that it only read...
"main_browser.navigate("html files\main.html") where "html files" is a
sub-folder of the location of the executable file. It now won't work.
I've used an if statement to check that the file exists and the code to
navigate should only occur if the file is found. When stepping through
the code the file is definately found-in fact the file can be opened
with a streamreader and edited! But it won't open in the browser
window.

Anyone know why?

Also, this is the first time I've made an executable version of the
program (I've previously just been running it by pressing F5). When I
ran the .exe file my firewall popped up and told me that the program
was trying to connect to a DNS server! Why on earth would it do that?

Any help would be greatly appreciated,

thanks,

Steve

Mar 26 '06 #2

P: n/a
Brilliant, thank you so much for your help.

Steve

Mar 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.