473,404 Members | 2,174 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,404 software developers and data experts.

giving a user ALL_ACCESS to a file/directory

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
5 2794
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Todd Beaulieu | last post by:
Hello, I'm using the configuration block to store user settings in the app.config file. As this exe will reside on a network drive, I can't have users trying to update the master app.config...
5
by: Dave Kolb | last post by:
Is there any other solution for an ASPNET application to access network resources other than running as SYSTEM, using delegation (a nightmare to get to work) or the COM+ solution? I cannot seem to...
3
by: Amir Eshterayeh | last post by:
Dear Friends Would you please give me your professional idea about this asp.net problem. I need different virtual directory for different customer with their names like these:...
0
by: stkoh | last post by:
We have a situation where we want users in an asp.net application to access the same directory containing image files (tif,jpg,etc). When a user click's a button, then the next available image in...
5
by: washoetech | last post by:
Hello, I have tried to run my ASP.NET 2.0 application from IIS and I get a page not found error. When I debug from within Visual Studio.NET 2005 my application works fine. Any ideas? ...
5
by: Dean Slindee | last post by:
I store several application settings in the project's "app.config" file. I also have a form that reads these values and displays them in a listview so that the user can adjust them. My question...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
5
by: cmk128 | last post by:
Hi I have built a free-php-space website, after the user is registered, he will have 100MB php space. the server is linux+apache. The location of the user's file is in: /phpspace/<username> ...
5
by: Sendil kumar | last post by:
Hi All, The FtpWebRequest.GetResponse( ) method is not giving "550 File not found exception " when I do a directory list operation on a invalid(not present) directory in HP Unix and Sun Solaris...
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: 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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.