473,320 Members | 1,831 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,320 software developers and data experts.

Access to Path Denied

I'm trying to write a simple app to verify that my data is being backed up
using a mirroring tool (and, perhaps, to make my own tool that does
specifically what I need)...
DirectoryInfo di = new DirectoryInfo(@"C:\users\schmidm");

FileInfo[] fiArr = di.GetFiles("*.*",
SearchOption.AllDirectories);

Results in:

Access to the path 'C:\users\schmidm\Templates' is denied.

Thoughts? What other headaches will I run into with the wonderful world of
windows security?

TIA

Sep 4 '08 #1
2 1487
On Sep 4, 3:32*pm, "Martin" <n...@try.comwrote:
>
Access to the path 'C:\users\schmidm\Templates' is denied.

Thoughts? *What other headaches will I run into with the wonderful world of
windows security?
Seems like this is a network question, which, like you say, involves
security. For example from my User account, if I try and write a file
to the Administrator account in XP/Vista, it will fail, as I don't
have permission.

This comes up even with standalone database programming--when I was
playing around with SQL Server a while ago, this would pop up. So I
ended up, for programming purposes, storing everything on the local
subdirectory the program was being executed in, but, like you say, for
your mirroring program that won't do.

In C# there is a class to fool with the stream permissions, you might
want to Google this assuming no more help here, though I think that
class deals with encoding a file so it cannot be read without the
proper permission, rather than what you seem to want (writing to a
directory).

RL
Sep 4 '08 #2
Hi Martin,

... and .NET Security, http://msdn.microsoft.com/en-us/libr...29(VS.71).aspx

Anyway, it's a "known bug" to failure passing through entire folder tree
using DirectoryInfo and if at least one folder is protected. Use iterating
through folders with checking instead, such as: http://forums.msdn.microsoft.com/en-...-3544e6cd1ae1/

Regards, Alex Meleta
mailto:am*****@gmail.com; blog:devkids.blogspot.com
AllDirectories
Thoughts? What other headaches will I run into with the wonderful world
of windows security?

Sep 5 '08 #3

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

Similar topics

4
by: Fabian von Romberg | last post by:
Hi, I have installed Sql Reporting Services on 2 machines, one is WIN 2000 PRO and the other one is WIN 2000 ADV. SERVER. When I try to access a report using the webbrowser, I get the following...
4
by: Fabian von Romberg | last post by:
Hi, I have installed Sql Reporting Services on 2 machines, one is WIN 2000 PRO and the other one is WIN 2000 ADV. SERVER. When I try to access a report using the webbrowser, I get the following...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
1
by: cpajoe2001 | last post by:
I am having an issue and after searching around online for a day and half now and finding others with the same problem but yet no solution to my issue I am looking for help. What i have is ServerA...
8
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.