By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,671 Members | 1,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,671 IT Pros & Developers. It's quick & easy.

giving a user ALL_ACCESS to a file/directory

P: n/a
I'd like to set the permissions on a file (directory) so that a user (and
only that user) is granted full control for that file.
Using c++, I was able to use the BuildExplicitAccessWithName, and
SetEntriesInAcl calls.
Is there a native c# way to do this?

Aryeh
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Aryeh,

These APIs are not represented in .NET. You will have to make the calls
to the native code through the P/Invoke layer.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Aryeh Katz" <ar********@vasco.com> wrote in message
news:MP************************@news.microsoft.com ...
I'd like to set the permissions on a file (directory) so that a user (and
only that user) is granted full control for that file.
Using c++, I was able to use the BuildExplicitAccessWithName, and
SetEntriesInAcl calls.
Is there a native c# way to do this?

Aryeh

Nov 13 '05 #2

P: n/a
In article <#U*************@tk2msftngp13.phx.gbl>,
ni**************@exisconsulting.com says...
Aryeh,

These APIs are not represented in .NET. You will have to make the calls
to the native code through the P/Invoke layer.
I read that doing the ACL to c# conversion is very tricky in
the "Using Win32 and Other Libraries" article by Eric Gunnerson.
(I see now that the example he gives is SetEntriesInAcl. Silly me).
I guess my best hope is to launch a c++ program that I already
wrote that does this task. Hope this helps.

Thank you.
Aryeh

Nov 13 '05 #3

P: n/a
Aryeh,

If you already have code in C++ that does it, you could create managed
wrappers, or expose the C++ code as a COM object, and then import those into
..NET.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Aryeh Katz" <ar********@vasco.com> wrote in message
news:MP***********************@news.microsoft.com. ..
In article <#U*************@tk2msftngp13.phx.gbl>,
ni**************@exisconsulting.com says...
Aryeh,

These APIs are not represented in .NET. You will have to make the calls to the native code through the P/Invoke layer.

I read that doing the ACL to c# conversion is very tricky in
the "Using Win32 and Other Libraries" article by Eric Gunnerson.
(I see now that the example he gives is SetEntriesInAcl. Silly me).
I guess my best hope is to launch a c++ program that I already
wrote that does this task.
Hope this helps.

Thank you.
Aryeh

Nov 13 '05 #4

P: n/a
In article <O4**************@TK2MSFTNGP10.phx.gbl>,
ni**************@exisconsulting.com says...
Aryeh,

If you already have code in C++ that does it, you could create managed
wrappers, or expose the C++ code as a COM object, and then import those into
.NET.

Shrug.
The code base I'm working with is quite small, and is part of a
standalone executable.
I suppose I could make it into a dll, and use managed wrappers, but
what's the point?
Why shouldn't I just invoke the executable?
Aryeh
P.S. As I'm new to c#, do you have any good articles about invoking
a com interface in c# and managed wrappers. I've been too busy problem
solving to actually have a go at some documentation (Bad, I know.)
Nov 13 '05 #5

P: n/a
Aryeh,

You could make a call out to the executable, but you promote code reuse
and good design by exposing it as a library of classes.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Aryeh Katz" <ar********@vasco.com> wrote in message
news:MP************************@news.microsoft.com ...
In article <O4**************@TK2MSFTNGP10.phx.gbl>,
ni**************@exisconsulting.com says...
Aryeh,

If you already have code in C++ that does it, you could create managed wrappers, or expose the C++ code as a COM object, and then import those into .NET.

Shrug.
The code base I'm working with is quite small, and is part of a
standalone executable.
I suppose I could make it into a dll, and use managed wrappers, but
what's the point?
Why shouldn't I just invoke the executable?
Aryeh
P.S. As I'm new to c#, do you have any good articles about invoking
a com interface in c# and managed wrappers. I've been too busy problem
solving to actually have a go at some documentation (Bad, I know.)

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.