how to get a file to display from relative filespec

G

GS

I have in the project directory an html file that I want my solution to
display. what how can I specify it in a hosted web browser? How would I
specify the file spec for the html without absolute path?

In c I could use getmoduleFileName to find out the directory for the module
and from there I can use relative path. In Java, I can use some resource
function.


I tried searching the built-in help for vb.net 2005 express, but no luck,
search on the web, so far I have not found something relevant yet.


Please help

Thank you for your effort and time.
 
R

Robinson

GS said:
I have in the project directory an html file that I want my solution to
display. what how can I specify it in a hosted web browser? How would I
specify the file spec for the html without absolute path?

In c I could use getmoduleFileName to find out the directory for the
module
and from there I can use relative path. In Java, I can use some resource
function.


I tried searching the built-in help for vb.net 2005 express, but no luck,
search on the web, so far I have not found something relevant yet.


Please help

Thank you for your effort and time.


Application.ExecutablePath will return the path your program is running
from. If its always relative to that, then you can use it to construct a
full path.
 
G

GS

fantastic! Thank you very much, Robinson.

Robinson said:
Application.ExecutablePath will return the path your program is running
from. If its always relative to that, then you can use it to construct a
full path.
 
G

GhostInAK

Hello gs,

..ExecutablePath returns the full path to the currently running instance.
You will probably want .StartupPath

-Boo
 
G

GS

thank you, "GhostInAK". Definitely StartPath is the way to go for my
purpose - it got rid of 2 lines of codes..
 

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