日期:2014-05-19  浏览次数:20843 次

找高人 关于用C# 编程 与EXCHANGE 最新遇到的問題
我用的是这个   API   函数   public   virtual   new   void   NtAccountCreate   (   System.String   bstrDomain   ,   System.String   bstrUserLogin   ,   System.String   bstrPassword   ,   System.String   bstrUserComment   ,   System.String   bstrLocalGroup   )


using   System;
using   System.Collections;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Web;
using   System.Web.SessionState;
using   System.Web.UI;
using   System.Web.UI.WebControls;
using   System.Web.UI.HtmlControls;
using   MSExchangeAcctLib;
namespace   exchangetest
{
///   <summary>
///   Summary   description   for   WebForm1.
///   </summary>
public   class   WebForm1   :   System.Web.UI.Page
{
protected   System.Web.UI.WebControls.Button   Button1;
public   MSExchangeAcctLib.IAcctMgmt   sd;
             

private   void   Button1_Click(object   sender,   System.EventArgs   e)
{
//sd.NtAccountDelete( "utpcb.com ", "py-wang ");

/*/   public   abstract   new   void   NtAccountCreate   (   System.String   bstrDomain   ,   System.String   bstrUserLogin   ,   System.String   bstrPassword   ,   System.String   bstrUserComment   ,   System.String   bstrLocalGroup   )
        Member   of   MSExchangeAcctLib.IAcctMgmt
這些是介紹用法的   */


  sd.NtAccountCreate( "域名 ", "新加的用户 ", "新加的用户密码 ", " ", "所属的组 ");
TextBox1.Text= "nihao ";

}
 
        private   void   Page_Load(object   sender,   System.EventArgs   e)
{
//   Put   user   code   to   initialize   the   page   here
}

#region   Web   Form   Designer   generated   code
override   protected   void   OnInit(EventArgs   e)
{
//
//   CODEGEN:   This   call   is   required   by   the   ASP.NET   Web   Form   Designer.

InitializeComponent();
base.OnInit(e);
}

///   <summary>
///   Required   method   for   Designer   support   -   do   not   modify
///   the   contents   of   this   method   with   the   code   editor.
///   </summary>
private   void   InitializeComponent()
{        
this.Button1.Click   +=   new   System.EventHandler(this.Button1_Click);
this.Load   +=   new   System.EventHandler(this.Page_Load);

}
#endregion


}
}
我的目的很简单   就是按下BUTTON就能加入我写入的用户名和密码
环境是   WIN2000     2003.NET  
我运行点BUTTON后出现以下错误


Server   Error   in   '/exchangetest '   Application.
--------------------------------------------

存取被拒。  
Description:   An   unhandled   exception   occurred   during   the   execution