Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

directoryentry value

Posted on 2013-12-19
5
Medium Priority
?
205 Views
Last Modified: 2014-01-08
I'm creating a group using this:
Dim group As DirectoryEntry = adEntry.Children.Add(strCN,"group")

At this point, while debugging, I can use
debug.print group.justcreated
and it returns True.

However, if I try to access that value in my code, I get
justcreated is not a member of system.directoryservices.directoryentry
0
Comment
Question by:sirbounty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 15

Expert Comment

by:unknown_routine
ID: 39729654
justcreated is not currency a member of directoryentry.

You can see the list of members here:

http://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry_members(v=vs.71).aspx


I guess what you see could be the reason of incompatibility between different versions of .NEt Framework.


I suggest to you Exist method instead of justcreated . Exists is in all version of ,Net Framework.

debug.print group.Exists("c\MyFolder")
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39730027
.exists doesn't work for what I'm trying to do...  this is not a directory as in a folder, this is a directory as in Active Directory object...
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 39743904
JustCreated is a private member which normally cannot be used in your own code (only inside the class itself) but is visible to the debugger.

If you add your variable group to the watch list, you will see a number of members/properties/methods that have an icon with a key to the left of it. That indicates they're private.
capture watchlistYou can get to the value of private members using Reflection:
Imports System.Reflection
' ...
        'Dim group As New DirectoryEntry() ' my test object
        Dim typDirectoryEntry As Type = GetType(DirectoryEntry) ' or group.GetType()
        For Each objMemberInfo As MemberInfo In typDirectoryEntry.GetMembers(BindingFlags.Instance Or BindingFlags.NonPublic)
            Console.WriteLine("name: {0}", objMemberInfo.Name)
            If objMemberInfo.Name = "JustCreated" Then Console.WriteLine("found it! value = {0}", typDirectoryEntry.GetField(objMemberInfo.Name, -1).GetValue(group).ToString)
        Next

Open in new window

0
 
LVL 67

Author Comment

by:sirbounty
ID: 39754046
Holidays...will check soon and get back to you.  Thanks.
0
 
LVL 67

Author Closing Comment

by:sirbounty
ID: 39765011
Brilliant.  I've maxed the points because this is going to be very useful.  Thanks! :^)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question