none
Вопрос по программированию: RRS feed

  • Вопрос

  • ???? ?????????. ?? GotDotNet ?? ????????. ????? ??? ???-?? ???-?? ????? ???????????

     

    ???? ? ???, ??? ? ????? ?? C# ????. ???? ?? ????????? ??????? ????? ?????????????? ?????????? ???????? (? ????? ? ??, ?????? ????? ??????? ? ???? ????????) ????????? ???????? ????? ???-?????????. ??????????? ??????? ? ???????? ??? ????? ??????? ?? IT.

     

    ?????? ??????? ?? PHP ??????? ???????, ? ??? ? C# ????????.

     

    ??? ?????? ???: http://msdn2.microsoft.com/en-us/library/ms676310.aspx

     

    ???????? ? ??????:

    Unspecified error

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Runtime.InteropServices.COMException: Unspecified error

     

    Source Error:

    Line 27: ent.Properties["member"].Add(newMember);

     

    ??? ???? ?????? ?????? ????????, ????????? ? ?? ???????? ???????? ?????????. ??? ??? ???? ???????.

     

     

     

    ??? ???. ??????? ? ???????? ?????? ??????…

    using System;

    using System.Data;

    using System.Configuration;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Web.UI.HtmlControls;

    using System.Security.Principal;

    using System.DirectoryServices;

    using System.DirectoryServices.ActiveDirectory;

    using System.Runtime.InteropServices;

     

    /// <summary>

    /// ????????? ? Active Directory

    /// </summary>

     

    public class ADChange : System.Web.UI.Page

    {

        public void AddMember()

        {

            string objectString = "CN=TestGroup,OU=Groups,OU=ITID,DC=corp,DC=ru";

            string newMember = "CN=TestUser,OU=Users,OU=ITID,DC=corp,DC=ru";

            {

                DirectoryEntry ent = new DirectoryEntry(objectString,"corp\Admin","123");

                ent.Properties["member"].Add(newMember);

                ent.CommitChanges();

            }

        }   

    }

     

    ? web.config

    <authentication mode="Windows"/>

     

    ??????? ??????? ???? ??????????????.

    5 февраля 2007 г. 5:25

Ответы

Все ответы