Home All Groups Group Topic Archive Search About

Howto create file shares and configure permissions in .NET?

Author
16 May 2006 12:55 PM
bva
Hi,

how can I create a file share and set permissions for it in .NET 2.0?

Thanks for help!

Author
16 May 2006 1:35 PM
Vadym Stetsyak
Hello, bva!

b> how can I create a file share and set permissions for it in .NET 2.0?

You can P/Invoke on NetShareAdd win32 function to add shares.
And if you're under .NET 1.1 you'll have to P/Invoke on Security API to set ACL on shared resources.

If you're under .NET 2.0, take a look at DirectorySecurity class and System.Security.AccessControl...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
17 May 2006 10:42 AM
bva
Hello Vadym,

thank you, it's working :)

Regards,
Benedikt van Almsick

Show quote
"Vadym Stetsyak" wrote:

> Hello, bva!
>
>  b> how can I create a file share and set permissions for it in .NET 2.0?
>
> You can P/Invoke on NetShareAdd win32 function to add shares.
> And if you're under .NET 1.1 you'll have to P/Invoke on Security API to set ACL on shared resources.
>
> If you're under .NET 2.0, take a look at DirectorySecurity class and System.Security.AccessControl...
>
> --
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot
Author
23 May 2006 2:55 PM
thomasjohnholden
Benedikt, My apologies for butting into the post but I was wondering if
you had ever found a resolution to your post with the error containing
the string:

\REGISTRY\MACHINE\SOFTWARE\Microsoft\OLEAUT

I've tried replying to the post but it's over 30 days so It won't allow
me to.

I seem to have the same issue with a .Net2 app on a Citrix server but I
seem to have even less event / error data to work with. My error simply
lists a chunk of an xml configuration files we use to define settings
internal to the application. There is nothing in the event logs.

Thankyou for any help you can give!

Tom

AddThis Social Bookmark Button