Environment.SpecialFolder.ApplicationData problem

  • Thread starter Thread starter Brian Stoop
  • Start date Start date
B

Brian Stoop

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=True

I use this code:

"string
appdata=Environment.GetFolderPath(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,
 
The logged-in user must have FileIOPermissionAccess.PathDiscovery permission
to execute this method.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
Thanks Kevin.

When you say "must have this permission". Is this somthing set
environmentally, or is it just enabled it in code for any user?


Brian
 
I've made a general post, thanks for you help, B

Kevin Spencer said:
The logged-in user must have FileIOPermissionAccess.PathDiscovery
permission to execute this method.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
It is a System or Active Directory permission that must be granted to the
user account.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 

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

Back
Top