Click here to Skip to main content
15,891,789 members
Home / Discussions / C#
   

C#

 
QuestionWCF Throttling Behavior settings Pin
teknolog12318-May-11 0:39
teknolog12318-May-11 0:39 
QuestionRe: WCF Throttling Behavior settings Pin
Mark Salsbery18-May-11 6:08
Mark Salsbery18-May-11 6:08 
AnswerRe: WCF Throttling Behavior settings Pin
teknolog12319-May-11 22:31
teknolog12319-May-11 22:31 
GeneralRe: WCF Throttling Behavior settings Pin
Mark Salsbery20-May-11 4:01
Mark Salsbery20-May-11 4:01 
QuestionControl integrity of ZIP files Pin
abbd18-May-11 0:30
abbd18-May-11 0:30 
AnswerRe: Control integrity of ZIP files Pin
Eddy Vluggen18-May-11 10:35
professionalEddy Vluggen18-May-11 10:35 
QuestionEnumerating directories/shares (and their Permissions) [modified] Pin
devvvy17-May-11 23:25
devvvy17-May-11 23:25 
AnswerRe: Enumerating directories/shares (and their Permissions) [modified] Pin
devvvy18-May-11 21:09
devvvy18-May-11 21:09 
I think I found how to enumerate share permissions. However, I can't interpret AccessMask = 1179817, MSDN didn't help (none of listed constants matches 1179817)[^]

I stumbled across this[^]
<br />
# Constants<br />
$SHARE_READ = 1179817<br />
$SHARE_CHANGE = 1245462<br />
$SHARE_FULL = 2032127<br />
$SHARE_NONE = 1<br />

Compared against actually setting, "1179817" is indeed READ.

<br />
ManagementObject sharedFolder = WMIUtil.GetSharedFolderObject("TestShare$");<br />
                ManagementBaseObject securityDescriptorObject = sharedFolder.InvokeMethod("GetSecurityDescriptor", null, null);<br />
                ManagementBaseObject securityDescriptor = securityDescriptorObject.Properties["Descriptor"].Value as ManagementBaseObject;<br />
                int existingAcessControlEntriesCount = 0;<br />
                ManagementBaseObject[] accessControlList = securityDescriptor.Properties["DACL"].Value as ManagementBaseObject[];<br />
                existingAcessControlEntriesCount = accessControlList.Length;<br />
                Array.Resize(ref accessControlList, accessControlList.Length + 1);<br />
                foreach (ManagementBaseObject o in accessControlList)<br />
                {<br />
                    WMIUtil.DisplayProperties(o);<br />
                }<br />
<br />


Now ...
<br />
public static void DisplayProperties(ManagementBaseObject o)<br />
        {<br />
            if (o == null)<br />
            {<br />
                return;<br />
            }<br />
<br />
            Console.WriteLine();<br />
            Console.WriteLine("Object: " + o);<br />
<br />
            foreach (PropertyData prop in o.Properties)<br />
            {<br />
                if (prop.Value is ManagementBaseObject)<br />
                {<br />
                    ManagementBaseObject childObj = (ManagementBaseObject)prop.Value;<br />
                    DisplayProperties(childObj);<br />
                }<br />
                else<br />
                {<br />
                    Console.WriteLine("Property - " + prop.Name + ": " + prop.Value);<br />
                }<br />
            }<br />
<br />
            foreach (PropertyData prop in o.SystemProperties)<br />
            {<br />
                Console.WriteLine("SystemProperty - " + prop.Name + ": " + prop.Value);<br />
            }<br />
<br />
            foreach (QualifierData Qualifier in o.Qualifiers)<br />
            {<br />
                Console.WriteLine("Qualifier - " + Qualifier.Name + ": " + Qualifier.Value);<br />
            }<br />
<br />
            return;<br />
        }<br />

dev
modified on Thursday, May 19, 2011 3:30 AM

QuestionWill Dispose() be called by GC? Pin
Chesnokov Yuriy17-May-11 20:54
professionalChesnokov Yuriy17-May-11 20:54 
AnswerRe: Will Dispose() be called by GC? Pin
Mark Salsbery17-May-11 21:37
Mark Salsbery17-May-11 21:37 
AnswerRe: Will Dispose() be called by GC? [modified] Pin
Shameel18-May-11 0:23
professionalShameel18-May-11 0:23 
AnswerRe: Will Dispose() be called by GC? Pin
Pete O'Hanlon18-May-11 1:26
mvePete O'Hanlon18-May-11 1:26 
GeneralRe: Will Dispose() be called by GC? Pin
Shameel18-May-11 2:21
professionalShameel18-May-11 2:21 
GeneralRe: Will Dispose() be called by GC? Pin
Pete O'Hanlon18-May-11 3:18
mvePete O'Hanlon18-May-11 3:18 
GeneralRe: Will Dispose() be called by GC? Pin
Shameel18-May-11 3:41
professionalShameel18-May-11 3:41 
AnswerRe: Will Dispose() be called by GC? Pin
PIEBALDconsult18-May-11 2:49
mvePIEBALDconsult18-May-11 2:49 
QuestionOpen Auto Cad File Pin
Anubhava Dimri17-May-11 17:44
Anubhava Dimri17-May-11 17:44 
AnswerRe: Open Auto Cad File Pin
Richard MacCutchan17-May-11 21:21
mveRichard MacCutchan17-May-11 21:21 
AnswerRe: Open Auto Cad File Pin
Dalek Dave22-May-11 0:38
professionalDalek Dave22-May-11 0:38 
QuestionUsing threads to process a collection [modified] Pin
LetMeFinclOut17-May-11 15:03
LetMeFinclOut17-May-11 15:03 
AnswerRe: Using threads to process a collection Pin
Not Active17-May-11 16:30
mentorNot Active17-May-11 16:30 
GeneralRe: Using threads to process a collection Pin
LetMeFinclOut17-May-11 17:13
LetMeFinclOut17-May-11 17:13 
AnswerRe: Using threads to process a collection Pin
Luc Pattyn17-May-11 18:30
sitebuilderLuc Pattyn17-May-11 18:30 
GeneralRe: Using threads to process a collection Pin
LetMeFinclOut18-May-11 0:49
LetMeFinclOut18-May-11 0:49 
GeneralRe: Using threads to process a collection Pin
Luc Pattyn18-May-11 1:59
sitebuilderLuc Pattyn18-May-11 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.