Results 1 to 4 of 4

Thread: URL getting absolute path from relative path vb.net

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    URL getting absolute path from relative path vb.net

    Say URL1: http://domainname.com/hi/hello/world/ilikethis.htm
    RelativePath: ../../hello.htm

    Hence absolute path is http://domainname.com/hi/hello.htm

    Is there a function that do that?

  2. #2
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589

    Re: URL getting absolute path from relative path vb.net

    Are you talking about Server side... If yes... then there are functions for example in php, to get the absolute path of current script file by magic constant
    __FILE__

    $_SERVER['PHP_SELF'] gives the relative path of the file from the ROOT directory

    $_SERVER['DOCUMENT_ROOT'] gives the server path.

    Now... there must be functions in ASP, JSP and other scripts to perform these functions on server side.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: URL getting absolute path from relative path vb.net

    I am talking about client side. In vb.net

    In general, if we look at a site http://domainname.com/soemthing/somewhere

    and then there is a link there <a href="hithere.htm">

    Clicking on the link will make us go to http://domainname.com/soemthing/somewhere/hithere.htm right?

    How to turn http://domainname.com/soemthing/somewhere and hithere.htm into http://domainname.com/soemthing/somewhere/hithere.htm

    Notice it also needs to be able to handle variants. Things like ../../hithere.html will produce http://domainname.com/hithere.htm

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: URL getting absolute path from relative path vb.net

    Never mind. URI constructors do that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width