Environment.SpecialFolder.ApplicationData problem

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,
 
K

Kevin Spencer

The logged-in user must have FileIOPermissionAccess.PathDiscovery permission
to execute this method.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
B

Brian Stoop

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
 
B

Brian Stoop

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
 
K

Kevin Spencer

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

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,504
Latest member
SherryFerr

Latest Threads

Top