ASP.NET current directory

Discussion in 'ASP .Net' started by Progman, Mar 2, 2006.

  1. Progman

    Progman Guest

    I use Visual Studio 2005

    When I run

    msgbox Curdir(), I get the visual studio directory.

    This problem seems to be only in the VB part. In the ASP, we use ~/etc... to
    access files.

    Why I dont get my project directory?

    When I will FTP this project to the host, what will be the current directory
    by default?

    Should I do something to make sure the current directory is my project
    directory.
    Progman, Mar 2, 2006
    #1
    1. Advertising

  2. Would :

    Server.MapPath(".")

    help ?



    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "Progman" <> wrote in message news:rJJNf.6094$W%...
    >I use Visual Studio 2005
    >
    > When I run
    >
    > msgbox Curdir(), I get the visual studio directory.
    >
    > This problem seems to be only in the VB part. In the ASP, we use ~/etc... to access files.
    >
    > Why I dont get my project directory?
    >
    > When I will FTP this project to the host, what will be the current directory by default?
    >
    > Should I do something to make sure the current directory is my project directory.
    >
    >
    >
    >
    Juan T. Llibre, Mar 2, 2006
    #2
    1. Advertising

  3. Progman

    Progman Guest

    yeah i just saw this

    Server.MapPath("~")

    "Juan T. Llibre" <> wrote in message
    news:...
    > Would :
    >
    > Server.MapPath(".")
    >
    > help ?
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > aspnetfaq.com : http://www.aspnetfaq.com/
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ===================================
    > "Progman" <> wrote in message
    > news:rJJNf.6094$W%...
    >>I use Visual Studio 2005
    >>
    >> When I run
    >>
    >> msgbox Curdir(), I get the visual studio directory.
    >>
    >> This problem seems to be only in the VB part. In the ASP, we use ~/etc...
    >> to access files.
    >>
    >> Why I dont get my project directory?
    >>
    >> When I will FTP this project to the host, what will be the current
    >> directory by default?
    >>
    >> Should I do something to make sure the current directory is my project
    >> directory.
    >>
    >>
    >>
    >>

    >
    >
    Progman, Mar 2, 2006
    #3
  4. Well, if you're 3 subdirectories down from the root,
    Server.MapPath("~") will return the correct application root dir,
    but I thought you were asking about the *current* directory
    ( the directory in which the current page is executing ).

    In any case, if that's what you were looking for...



    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "Progman" <> wrote in message news:z7LNf.7777$W%...
    > yeah i just saw this
    >
    > Server.MapPath("~")


    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> Would :
    >>
    >> Server.MapPath(".")
    >>
    >> help ?
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> aspnetfaq.com : http://www.aspnetfaq.com/
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ===================================
    >> "Progman" <> wrote in message
    >> news:rJJNf.6094$W%...
    >>>I use Visual Studio 2005
    >>>
    >>> When I run
    >>>
    >>> msgbox Curdir(), I get the visual studio directory.
    >>>
    >>> This problem seems to be only in the VB part. In the ASP, we use ~/etc... to access files.
    >>>
    >>> Why I dont get my project directory?
    >>>
    >>> When I will FTP this project to the host, what will be the current directory by default?
    >>>
    >>> Should I do something to make sure the current directory is my project directory.
    Juan T. Llibre, Mar 2, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manu
    Replies:
    1
    Views:
    6,082
    Natty Gur
    Jul 20, 2003
  2. PHaroZ
    Replies:
    5
    Views:
    94,682
    akash02sap
    Aug 17, 2012
  3. =?Utf-8?B?QmFzIEhlbmRyaWtz?=

    Directory and files names in temporary asp.net directory

    =?Utf-8?B?QmFzIEhlbmRyaWtz?=, Jan 28, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    822
    Juan T. Llibre
    Jan 31, 2005
  4. Matthew Heidemann
    Replies:
    14
    Views:
    232
    eT Ma
    Mar 22, 2011
  5. Jack
    Replies:
    3
    Views:
    583
    Tad J McClellan
    Dec 22, 2008
Loading...

Share This Page