Click here to Skip to main content
15,921,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HELP! I'm desprate! I created a web browser from "Common Controls". When I type following line:
webBrowser1.Navigate("somedir\\somefile.htm");
, I get nothing in browser.
Posted

Please try to use a real URL. IE is spoiling you all by guessing where an url points to and doing "the right thing" (well at least what the IE developers thought should be the right thing).

Use this for an URL to the file system
String fileURL = "file:///C:/Folder1/folder2/someFile.html";

You'll have to use the correct drive and folder names of your system.

Cheers,

Manfred
 
Share this answer
 
Try putting the code into a try/catch block and then running the app under the debugger.

And oh yeah - use forward slashes instead of backslashes in the file name you're trying to browse to.

 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900