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 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
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
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
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.)
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.) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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:...
|
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...
|
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?
...
|
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...
|
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...
|
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>
...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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: 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...
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |