ASP.NET Temp directory

Discussion in 'ASP .Net' started by santos_sergio@hotmail.com, Mar 1, 2005.

  1. Guest

    Hi,


    Does anyone know how to retrieve
    "C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
    directory name programmatically ?

    Thanks in advance.

    Sérgio Silva
     
    , Mar 1, 2005
    #1
    1. Advertising

  2. string s = @"C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET
    Files";

    --
    ;-),

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    <> wrote in message
    news:...

    Hi,


    Does anyone know how to retrieve
    "C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
    directory name programmatically ?

    Thanks in advance.

    Sérgio Silva
     
    Kevin Spencer, Mar 1, 2005
    #2
    1. Advertising

  3. Actually, what I meant to say was, it isn't stored somewhere, except in your
    machine.config file. You could, I imagine, open the file as an XML document
    and find the "tempDirectory" node under "compilation" under "system.web"
    element to read it. I believe you can also override it in the web.config,
    but you can't use the ConfigurationSettings class to read it. You would
    still have to open it as an XML file.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    <> wrote in message
    news:...

    Hi,


    Does anyone know how to retrieve
    "C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
    directory name programmatically ?

    Thanks in advance.

    Sérgio Silva
     
    Kevin Spencer, Mar 1, 2005
    #3
  4. In Kevin's example you would have to hard code the {version} of the .NET
    framework you want to use and/or the folder path. As a catch all situation,
    you could retrieve this location where your page is being loaded from by:
    System.Reflection.Assembly.GetExecutingAssembly.Location.ToString()

    <> wrote in message
    news:...

    Hi,


    Does anyone know how to retrieve
    "C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
    directory name programmatically ?

    Thanks in advance.

    Sérgio Silva
     
    Tampa.NET Koder, Mar 1, 2005
    #4
  5. Well, I've learned something today. :-D

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "Tampa.NET Koder" <> wrote in message
    news:%...
    > In Kevin's example you would have to hard code the {version} of the .NET
    > framework you want to use and/or the folder path. As a catch all
    > situation, you could retrieve this location where your page is being
    > loaded from by:
    > System.Reflection.Assembly.GetExecutingAssembly.Location.ToString()
    >
    > <> wrote in message
    > news:...
    >
    > Hi,
    >
    >
    > Does anyone know how to retrieve
    > "C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
    > directory name programmatically ?
    >
    > Thanks in advance.
    >
    > Sérgio Silva
    >
    >
     
    Kevin Spencer, Mar 1, 2005
    #5
  6. Maybe taking a look at Christoph Wille's samples for
    "Directory Browsing the .NET Way" :
    http://www.aspheute.com/english/20000804.asp
    would give a hint as to how to do that.

    The System.IO namespace is full of wonders... ;-)



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Kevin Spencer" <> wrote in message
    news:...
    > Actually, what I meant to say was, it isn't stored somewhere, except in
    > your machine.config file. You could, I imagine, open the file as an XML
    > document and find the "tempDirectory" node under "compilation" under
    > "system.web" element to read it. I believe you can also override it in the
    > web.config, but you can't use the ConfigurationSettings class to read it.
    > You would still have to open it as an XML file.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > Neither a follower nor a lender be.
    >
    > <> wrote in message
    > news:...
    >
    > Hi,
    >
    >
    > Does anyone know how to retrieve
    > "C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
    > directory name programmatically ?
    >
    > Thanks in advance.
    >
    > Sérgio Silva
    >
    >
     
    Juan T. Llibre, Mar 1, 2005
    #6
  7. Guest

    Hi,

    I choose to get it from current appdomain temporary directory.

    AppDomain.CurrentDomain.SetupInformation.CachePath;

    The return is C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
    ASP.NET Files\2.0.0_scriptenginehost\407724a3

    It's fine with me.

    Thanks to all
     
    , Mar 2, 2005
    #7
    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. Lars Netzel

    temp directory for asp.net?

    Lars Netzel, Jan 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    545
    Steve C. Orr [MVP, MCSD]
    Jan 10, 2005
  2. Don
    Replies:
    0
    Views:
    2,758
  3. Replies:
    2
    Views:
    593
    Mark P
    May 9, 2005
  4. A. Farber
    Replies:
    3
    Views:
    299
    Ben Morrow
    Mar 3, 2004
  5. PerlFAQ Server
    Replies:
    0
    Views:
    280
    PerlFAQ Server
    Apr 26, 2011
Loading...

Share This Page