Environment.SpecialFolder.ApplicationData problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Stoop

    #1

    Environment.SpecialFolder.ApplicationData problem

    Hi,

    In my ASP.NET application I want to rerieve the APPDATA folder of the logged
    in user. The Web Application is using C# .NET 1.1 and has
    Impersonation=T rue

    I use this code:

    "string
    appdata=Environ ment.GetFolderP ath(Environment .SpecialFolder. ApplicationData ).ToString()";

    If my Web application is launched as an Administrator then variable gets
    set, but if the user who launches it is not a Domain Administrator the
    variable is blank and I get an Exception.


    Is this expected behviour?
    Can I expect this to work with .NET 2.0 ??

    thanks,


  • Kevin Spencer

    #2
    Re: Environment.Spe cialFolder.Appl icationData problem

    The logged-in user must have FileIOPermissio nAccess.PathDis covery permission
    to execute this method.

    --
    HTH,

    Kevin Spencer
    Chicken Salad Surgeon
    Microsoft MVP

    "Brian Stoop" <b.stoop@consul tant-spam.free.comwr ote in message
    news:%23NEsvVFg IHA.5348@TK2MSF TNGP03.phx.gbl. ..
    Hi,
    >
    In my ASP.NET application I want to rerieve the APPDATA folder of the
    logged in user. The Web Application is using C# .NET 1.1 and has
    Impersonation=T rue
    >
    I use this code:
    >
    "string
    appdata=Environ ment.GetFolderP ath(Environment .SpecialFolder. ApplicationData ).ToString()";
    >
    If my Web application is launched as an Administrator then variable gets
    set, but if the user who launches it is not a Domain Administrator the
    variable is blank and I get an Exception.
    >
    >
    Is this expected behviour?
    Can I expect this to work with .NET 2.0 ??
    >
    thanks,
    >

    Comment

    Working...