Partial path instead of full

computermat

Active member
Joined
Jun 17, 2007
Messages
28
Programming Experience
Beginner
Hi, sorry if this message is in the wrong place but I was unsure where to put it.

It may seem a noob question but can I navigate to a html file within my project without having to use a full system path and only use a partial path relating to a sub directory within my project.

I am currently using:
webbrowser1.navigate("C:\Documents and Settings\Matty\My Documents\Visual Studio 2005\Projects\Cmat Explorer\Cmat Explorer\html\aug.html")

If I use the following code I just get "action canceled"

webbrowser1.navigate("...\html\aug.html")

Can someone point me at the right code so when I compile the project and install on another drive it will navigate to the html file I want to use.

Thanks in advance
Matt
 
are you sure you have included that html file in your project and told it to ouput as part of the compile?
 
Thanks for the suggestion, the files i were using were not being recognized as html and did not have compile options.

I have changed my files but i am still getting "action canceled"

Thanks again for the help
matt
 
Last edited:
Thanks for the suggestion, the files i were using were not being recognized as html and did not have compile options.

I have changed my files but i am still getting "action canceled"

Thanks again for the help
matt

How i'd do it is:

put a folder in my project, called html
put the files in there
switch on "view all files" in solution explorer
right click the ghosted folder and choose Include in project
check that the folder and all its contents are set to "copy always" or "copy if newer" in the project options
build the project
go and look in the bin\debug folder to ensure the html folder is there along side the exe
use .\html\file.htm as my path in the code (maybe also with app.path or its equivalent)
 
hi, thanks for your help on this topic I have managed to sort out my problem by using the code (application.startuppath() & "\html\file.htm")

Thanks again and i am sure i will need to post on here in the future
Matt
 
Back
Top