473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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

I use this code:

"string
appdata=Environment.GetFolderPath(Environment.Spec ialFolder.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,
Mar 7 '08 #1
1 4628
The logged-in user must have FileIOPermissionAccess.PathDiscovery permission
to execute this method.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Brian Stoop" <b.*****@consultant-spam.free.comwrote in message
news:%2****************@TK2MSFTNGP03.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=True

I use this code:

"string
appdata=Environment.GetFolderPath(Environment.Spec ialFolder.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,

Mar 7 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mantorok | last post by:
Hi all Have 2 perculiar problems at the moment: 1) SpecialFolder enum is not being picked up in Intelli-sense (but it is compiling ok when I use this enum) 2) FolderBrowser displays an...
1
by: Chandler Chao | last post by:
I am trying to get the path of a user's Personal folder from within a web form. When I use the call: Environment.GetFolderPath(Environment.SpecialFolder.Personal) I get absolutely nothing...
0
by: Wiktor Zychla | last post by:
I need a patch that is returned by API's SHGetFolderPath with CSIDL_COMMON_DOCUMENTS. I expected to find it among other enums in Environment.SpecialFolder enumeration. But I cannot find it there. ...
3
by: David Meier | last post by:
Hi, is it possible to get the environment variables for users other than the user that is currently executing the application? For example if I run a system service, how can the service find...
2
by: Qwert | last post by:
Hello you, the Environment.SpecialFolder enumeration of .NET 1.0 doesn't have the member "MyComputer". Is there anyway to get this 'virtual folder' and its contents in another similar way? ...
1
by: codejunkie | last post by:
I am porting my current project to a 64 bit machine and I am having some issues with folder paths that vary between a 64 and 32 machine for any 32 bit application. The below calls return...
0
by: viral123 | last post by:
Hi All I just want to find the location of AppData in the user applicaiton. I can find that by just one line Environment.getPath(Environment.specialfolder.ApplicationData) If I run this...
2
by: Anil Gupte | last post by:
Why does System.Environment.SpecialFolder.Personal return "5"? How do I get the actual directory? Thanx, Anil Gupte www.keeninc.net www.icinema.com
1
by: cs_hart | last post by:
I am trying to get at the commandline using system.Environment.Commandline. But that is not defined. If I key in System.Environment. then autocomplete shows only Environment.SpecialFolder I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.