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

Can't get the rigth security settings of a desktop folder ??

Hi,

If I get the ACL of a desktop folder, I do not get the right security
settings.

(Directory is the folder on the desktop)

DirectoryInfo^ dir = DirInfo->Directory;
DirectorySecurity^ dirSecurity = DirInfo->GetAccessControl();
AuthorizationRuleCollection^ acl = nullptr;
acl = dirSecurity->GetAccessRules( true, true,
SecurityIdentifier::typeid );
for (int i = 0; i < acl->Count; i++) {
FileSystemAccessRule^ rule = dynamic_cast<FileSystemAccessRule^>(
acl[i] );
if ( AccessControlType::Allow.Equals( rule->AccessControlType ) )
{
bool bReadAllowed = ( ( (int)rule->FileSystemRights &
(int)FileSystemRights::Read ) == (int)FileSystemRights::Read );
// bReadAllowd becomes FALSE, while this is TRUE when checking
the security in the explorer
}
}
Does anyone know what I am doing wrong here ?
Thanks in advance, martin.
Apr 17 '07 #1
0 909

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

Similar topics

5
by: Norman Fritag | last post by:
Hi there, The Problem: I can't write data to an access database in a webfolder of a windows Prof 2000 machine, whereas the same web application runs fine under Windows XP. I looked into the...
11
by: Shyguy | last post by:
I need to import a text file pretty much daily. I download the file and change the name to a standard name and then run the code to import the file into a table in my database. The problem is...
3
by: wASP | last post by:
Hi, Apparently, I have a permissions issue. I am logged in as administrator, and my C: drive is accessible. Under the "Security" tab for Properties for Inetpub, for my "Internet Guest Account,"...
4
by: dennist685 | last post by:
Can't open my .mdb I was experimenting with opening an access database in IIS. For experimenting, I have an .mdb called HasbaraSample. In this case I copied it to the C:\Inetpub\wwwroot\Access...
2
by: Matthias Wohlmann | last post by:
Hi, I'm getting the following error when trying to start my application using Internet Explorer: "Server cannot access application directory D:\xxx. The directory does not exist or is not...
0
by: Thomas H. | last post by:
Hello, I have a problem with security-settings in a .NET Application. The application has a strong name and is full trusted ("Trust an assembly" - Full Trust), ..NET Security is set "Local...
22
by: Merlin | last post by:
Hello everyone, I realize that I'm new to the group, but I'm hoping that someone might be able to help me out. What I'm doing is using the GNU 7zip command line utility to make a backup on my...
0
by: Martin jensson | last post by:
Hi, If I get the ACL of a desktop folder, I do not get the right security settings. (Directory is the folder on the desktop) DirectoryInfo^ dir = fileInfo->Directory; FileSecurity^...
3
by: Earl Anderson | last post by:
One of the users in our departmental db has Read/Write permissions to a particular form. He was able to access and edit the form at will until 2 weeks ago. His current problem was that he was not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.