DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Chris Schrumm Guest

    Active Directory .Net and Browsing the directory


    The following code when embedded in a ASP.NET page allows you to enumerate
    through a the network with the rights of the account. When I view this information
    in the debug local variables windows I see a property called browseGranted
    and if I provide the correct password this is set to a value of true, however,
    I can't compile the code and call this property. The only way I've been
    able to call it is in the immediate window by typing Debug.Print dr.browseGranted.
    Any idea what I should do?

    using System.DirectoryServices;

    DirectoryEntry dr = new DirectoryEntry("WinNT://MyDomain", "username", "password",AuthenticationTypes.Secure);

    // this won't compile
    if(dr.browseGranted)
    {
    // send some message
    }

  2. #2
    Patrick Long Guest

    Re: Active Directory .Net and Browsing the directory

    There are a lot of things that you can see at debug time that are private to
    classes. This is probably one of those.

    Another common example is the Request class. In a posted back ASP.NET that
    will have a private _form object and a public FORM object. These both hold
    the returned form vars, both are accesible in the locals window but only one
    in your code.

    Pat

    "Chris Schrumm" <vb.@127.0.0.1> wrote in message
    news:3d56c5d0$1@10.1.10.29...
    >
    > The following code when embedded in a ASP.NET page allows you to

    enumerate
    > through a the network with the rights of the account. When I view this

    information
    > in the debug local variables windows I see a property called browseGranted
    > and if I provide the correct password this is set to a value of true,

    however,
    > I can't compile the code and call this property. The only way I've been
    > able to call it is in the immediate window by typing Debug.Print

    dr.browseGranted.
    > Any idea what I should do?
    >
    > using System.DirectoryServices;
    >
    > DirectoryEntry dr = new DirectoryEntry("WinNT://MyDomain", "username",

    "password",AuthenticationTypes.Secure);
    >
    > // this won't compile
    > if(dr.browseGranted)
    > {
    > // send some message
    > }




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links