A problem about DirectoryEntry.Properties

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wang.qiang

    #1

    A problem about DirectoryEntry.Properties

    I can't list the key-value pairs at runtime.The pairs list can not be
    retrieved.
    below is what I wrote
    DirectoryEntry nodeAdmin = de.Children.Fin d("IISAdmin","I IsWebVirtualDir ")
    // ,nodePrinters = de.Children.Fin d("Printers","I IsWebVirtualDir ");
    // IEnumerator enA = nodeAdmin.Prope rties.PropertyN ames.GetEnumera tor();
    // System.Director yServices.Prope rtyCollection m_pc =
    nodeAdmin.Prope rties;
    // IEnumerator m_AK = m_pc.PropertyNa mes.GetEnumerat or();
    // IEnumerator m_AV = m_pc.Values.Get Enumerator();
    // int i=0;
    // while(i<m_pc.Pr opertyNames.Cou nt)
    // { m_AK.MoveNext() ;
    // i++;
    // this.textBox1.T ext+=m_AK.Curre nt.ToString()+" \r\n";
    //
    //
    //
    // }


  • Marc Scheuner [MVP ADSI]

    #2
    Re: A problem about DirectoryEntry. Properties

    >I can't list the key-value pairs at runtime.The pairs list can not be[color=blue]
    >retrieved.[/color]

    What happens? Do you get an error? If so, what is it? If not - do you
    just not get any properties back? Maybe there aren't any properties
    set.....

    Marc
    =============== =============== =============== =============== ====
    Marc Scheuner May The Source Be With You!
    Bern, Switzerland m.scheuner(at)i nova.ch

    Comment

    • Qiang Wang

      #3
      Re: A problem about DirectoryEntry. Properties

      There are properties set.
      And there is an exception tells it can't list the properties because the
      number of properties can not be counted.
      And one more thing.I use the method DiretoryEntry.I nvoke
      to call the IIsWebServer.St op method, there is no parameter in the
      prototype of IIsWebServer.St op,what should I initiate the second
      parameter of Invoke method.

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Willy Denoyette [MVP]

        #4
        Re: A problem about DirectoryEntry. Properties

        Count is not returned by the IIS ADSI provider, use foreach to enumerate the collection.


        Willy.

        "wang.qiang " <wang.qiang@sha ngxin.com> wrote in message news:eNiqHH2oDH A.1496@TK2MSFTN GP11.phx.gbl...[color=blue]
        > I can't list the key-value pairs at runtime.The pairs list can not be
        > retrieved.
        > below is what I wrote
        > DirectoryEntry nodeAdmin = de.Children.Fin d("IISAdmin","I IsWebVirtualDir ")
        > // ,nodePrinters = de.Children.Fin d("Printers","I IsWebVirtualDir ");
        > // IEnumerator enA = nodeAdmin.Prope rties.PropertyN ames.GetEnumera tor();
        > // System.Director yServices.Prope rtyCollection m_pc =
        > nodeAdmin.Prope rties;
        > // IEnumerator m_AK = m_pc.PropertyNa mes.GetEnumerat or();
        > // IEnumerator m_AV = m_pc.Values.Get Enumerator();
        > // int i=0;
        > // while(i<m_pc.Pr opertyNames.Cou nt)
        > // { m_AK.MoveNext() ;
        > // i++;
        > // this.textBox1.T ext+=m_AK.Curre nt.ToString()+" \r\n";
        > //
        > //
        > //
        > // }
        >
        >[/color]


        Comment

        Working...