悬赏园豆:10
[已关闭问题]
关闭于 2008-05-21 11:18
<P>在园里看到有相关创建邮箱的资料。不过有一个问题请教大家。希望知道的回答一下。谢谢。下面是一段代码。其中 <FONT color=#ff0000>"CN=GWBN," 中的GWBN代表什么</FONT>?看了几个人的LDAPL路径格式都不能看出这个具体应该填写什么。</P>
<P>/// <summary><BR>/// 创建邮箱<BR>/// </summary><BR>/// <param name="strADSIUserPath">用户LDAP路径</param><BR>/// <param name="strExchServer">Exchange服务器名</param><BR>/// <param name="strDomainName">域名</param><BR>private static bool CreateCDOEXMailBox(string strADSIUserPath, string strExchServer, string strDomainName)<BR>{<BR> bool rv = false;<BR> try<BR> {<BR> string mdbURL = ADPath + "/" +<BR> "CN=邮箱存储("+ strExchServer + ")," +<BR> "CN=第一个存储组," +<BR> "CN=InformationStore," +<BR> "CN="+ strExchServer + "," +<BR> "CN=Servers," +<BR> "CN=第一个管理组," +<BR> "CN=Administrative Groups," +<BR> "CN=GWBN," + <BR> "CN=Microsoft Exchange," +<BR> "CN=Services," +<BR> "CN=Configuration," +strDomainName;<BR> Type objMailType = Type.GetTypeFromProgID("CreateMail.CreateExMail");<BR> Object objMail = Activator.CreateInstance(objMailType);<BR> Object[] myArg = {strADSIUserPath,mdbURL};<BR> object objAddStatus,objErrorInfo;<BR> objAddStatus = objMailType.InvokeMember("CreateCDOEXMailBox",BindingFlags.InvokeMethod,null,objMail,myArg);<BR> objErrorInfo = objMailType.InvokeMember("errorInfo",BindingFlags.GetProperty, null, objMail, new object[]{});<BR> rv = true;<BR> }<BR> catch(Exception ex)<BR> {<BR> if(ex.InnerException != null)<BR> {<BR> ex = ex.InnerException;<BR> }<BR> Trace.WriteLine(ex.ToString());<BR> }<BR> return rv;<BR>}<BR>注意如果你使用的exchange2003,则mdbURL不需改变,如果不是,则mdbURL变量你需要改一下。</P>
迭_戈
|
初学一级
|
园豆:
147
提问于:2008-01-23 16:29